#include "third_party/blink/renderer/modules/encryptedmedia/navigator_request_media_key_system_access.h"
#include <algorithm>
#include "base/memory/ptr_util.h"
#include "third_party/blink/public/mojom/permissions_policy/permissions_policy.mojom-blink.h"
#include "third_party/blink/public/platform/web_encrypted_media_client.h"
#include "third_party/blink/public/platform/web_encrypted_media_request.h"
#include "third_party/blink/public/platform/web_media_key_system_configuration.h"
#include "third_party/blink/public/platform/web_media_key_system_media_capability.h"
#include "third_party/blink/public/platform/web_vector.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.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/core/inspector/console_message.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_key_system_access.h"
#include "third_party/blink/renderer/modules/encryptedmedia/media_key_system_access_initializer_base.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/bindings/v8_throw_exception.h"
#include "third_party/blink/renderer/platform/encrypted_media_request.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/network/mime/content_type.h"
#include "third_party/blink/renderer/platform/network/parsed_content_type.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
namespace blink {
namespace {
class MediaKeySystemAccessInitializer final
: public MediaKeySystemAccessInitializerBase { … };
MediaKeySystemAccessInitializer::MediaKeySystemAccessInitializer(
ExecutionContext* context,
ScriptPromiseResolverBase* resolver,
const String& key_system,
const HeapVector<Member<MediaKeySystemConfiguration>>&
supported_configurations)
: … { … }
void MediaKeySystemAccessInitializer::RequestSucceeded(
std::unique_ptr<WebContentDecryptionModuleAccess> access) { … }
void MediaKeySystemAccessInitializer::RequestNotSupported(
const WebString& error_message) { … }
void MediaKeySystemAccessInitializer::StartRequestAsync() { … }
}
ScriptPromise<MediaKeySystemAccess>
NavigatorRequestMediaKeySystemAccess::requestMediaKeySystemAccess(
ScriptState* script_state,
Navigator& navigator,
const String& key_system,
const HeapVector<Member<MediaKeySystemConfiguration>>&
supported_configurations,
ExceptionState& exception_state) { … }
}