#include "third_party/blink/renderer/modules/encryptedmedia/media_key_system_access.h"
#include <memory>
#include <utility>
#include "base/memory/ptr_util.h"
#include "base/numerics/safe_conversions.h"
#include "media/base/eme_constants.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
#include "third_party/blink/public/platform/web_content_decryption_module.h"
#include "third_party/blink/public/platform/web_encrypted_media_types.h"
#include "third_party/blink/public/platform/web_media_key_system_configuration.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_media_key_system_media_capability.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/modules/encryptedmedia/content_decryption_module_result_promise.h"
#include "third_party/blink/renderer/modules/encryptedmedia/encrypted_media_utils.h"
#include "third_party/blink/renderer/modules/encryptedmedia/media_key_session.h"
#include "third_party/blink/renderer/modules/encryptedmedia/media_keys.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/timer.h"
namespace blink {
namespace {
class NewCdmResultPromise : public ContentDecryptionModuleResultPromise { … };
Vector<String> ConvertInitDataTypes(
const WebVector<media::EmeInitDataType>& init_data_types) { … }
HeapVector<Member<MediaKeySystemMediaCapability>> ConvertCapabilities(
const WebVector<WebMediaKeySystemMediaCapability>& capabilities) { … }
Vector<String> ConvertSessionTypes(
const WebVector<WebEncryptedMediaSessionType>& session_types) { … }
void ReportMetrics(ExecutionContext* execution_context,
const String& key_system) { … }
}
MediaKeySystemAccess::MediaKeySystemAccess(
std::unique_ptr<WebContentDecryptionModuleAccess> access)
: … { … }
MediaKeySystemAccess::~MediaKeySystemAccess() = default;
MediaKeySystemConfiguration* MediaKeySystemAccess::getConfiguration() const { … }
ScriptPromise<MediaKeys> MediaKeySystemAccess::createMediaKeys(
ScriptState* script_state) { … }
}