chromium/third_party/blink/renderer/modules/encryptedmedia/html_media_element_encrypted_media.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/modules/encryptedmedia/html_media_element_encrypted_media.h"

#include "base/compiler_specific.h"
#include "base/containers/span.h"
#include "media/base/eme_constants.h"
#include "third_party/blink/public/platform/task_type.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/bindings/core/v8/v8_throw_dom_exception.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/html/media/html_media_element.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_typed_array.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_encrypted_event.h"
#include "third_party/blink/renderer/modules/encryptedmedia/media_keys.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/content_decryption_module_result.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/self_keep_alive.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"

#define EME_LOG_LEVEL

namespace blink {

// This class allows MediaKeys to be set asynchronously.
class SetMediaKeysHandler : public GarbageCollected<SetMediaKeysHandler> {};

SuccessCallback;
FailureCallback;

// Represents the result used when setContentDecryptionModule() is called.
// Calls |success| if result is resolved, |failure| if result is rejected.
class SetContentDecryptionModuleResult final
    : public ContentDecryptionModuleResult {};

ScriptPromise<IDLUndefined> SetMediaKeysHandler::Create(
    ScriptState* script_state,
    HTMLMediaElement& element,
    MediaKeys* media_keys,
    const ExceptionContext& exception_context) {}

SetMediaKeysHandler::SetMediaKeysHandler(
    ScriptState* script_state,
    HTMLMediaElement& element,
    MediaKeys* media_keys,
    const ExceptionContext& exception_context)
    :{}

SetMediaKeysHandler::~SetMediaKeysHandler() = default;

void SetMediaKeysHandler::TimerFired(TimerBase*) {}

void SetMediaKeysHandler::ClearExistingMediaKeys() {}

void SetMediaKeysHandler::SetNewMediaKeys() {}

void SetMediaKeysHandler::Finish() {}

void SetMediaKeysHandler::Fail(WebContentDecryptionModuleException code,
                               const String& error_message) {}

void SetMediaKeysHandler::ClearFailed(WebContentDecryptionModuleException code,
                                      const String& error_message) {}

void SetMediaKeysHandler::SetFailed(WebContentDecryptionModuleException code,
                                    const String& error_message) {}

void SetMediaKeysHandler::Trace(Visitor* visitor) const {}

// static
const char HTMLMediaElementEncryptedMedia::kSupplementName[] =;

HTMLMediaElementEncryptedMedia::HTMLMediaElementEncryptedMedia(
    HTMLMediaElement& element)
    :{}

HTMLMediaElementEncryptedMedia::~HTMLMediaElementEncryptedMedia() {}

HTMLMediaElementEncryptedMedia& HTMLMediaElementEncryptedMedia::From(
    HTMLMediaElement& element) {}

MediaKeys* HTMLMediaElementEncryptedMedia::mediaKeys(
    HTMLMediaElement& element) {}

ScriptPromise<IDLUndefined> HTMLMediaElementEncryptedMedia::setMediaKeys(
    ScriptState* script_state,
    HTMLMediaElement& element,
    MediaKeys* media_keys,
    ExceptionState& exception_state) {}

// Create a MediaEncryptedEvent for WD EME.
static Event* CreateEncryptedEvent(media::EmeInitDataType init_data_type,
                                   const unsigned char* init_data,
                                   unsigned init_data_length) {}

void HTMLMediaElementEncryptedMedia::Encrypted(
    media::EmeInitDataType init_data_type,
    const unsigned char* init_data,
    unsigned init_data_length) {}

void HTMLMediaElementEncryptedMedia::DidBlockPlaybackWaitingForKey() {}

void HTMLMediaElementEncryptedMedia::DidResumePlaybackBlockedForKey() {}

WebContentDecryptionModule*
HTMLMediaElementEncryptedMedia::ContentDecryptionModule() {}

void HTMLMediaElementEncryptedMedia::Trace(Visitor* visitor) const {}

}  // namespace blink