#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/platform/media/web_content_decryption_module_impl.h"
#include <utility>
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/notreached.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "media/base/cdm_context.h"
#include "media/base/cdm_factory.h"
#include "media/base/cdm_promise.h"
#include "media/base/content_decryption_module.h"
#include "media/base/key_systems.h"
#include "third_party/blink/public/platform/url_conversion.h"
#include "third_party/blink/public/platform/web_security_origin.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/renderer/platform/media/cdm_result_promise.h"
#include "third_party/blink/renderer/platform/media/cdm_session_adapter.h"
#include "third_party/blink/renderer/platform/media/web_content_decryption_module_session_impl.h"
#include "url/origin.h"
namespace blink {
namespace {
const char kCreateSessionSessionTypeUMAName[] = …;
const char kSetServerCertificateUMAName[] = …;
const char kGetStatusForPolicyUMAName[] = …;
}
void WebContentDecryptionModuleImpl::Create(
media::CdmFactory* cdm_factory,
media::KeySystems* key_systems,
const WebSecurityOrigin& security_origin,
const media::CdmConfig& cdm_config,
WebCdmCreatedCB web_cdm_created_cb) { … }
WebContentDecryptionModuleImpl::WebContentDecryptionModuleImpl(
base::PassKey<CdmSessionAdapter>,
scoped_refptr<CdmSessionAdapter> adapter,
media::KeySystems* key_systems)
: … { … }
WebContentDecryptionModuleImpl::~WebContentDecryptionModuleImpl() = default;
std::unique_ptr<WebContentDecryptionModuleSession>
WebContentDecryptionModuleImpl::CreateSession(
WebEncryptedMediaSessionType session_type) { … }
void WebContentDecryptionModuleImpl::SetServerCertificate(
const uint8_t* server_certificate,
size_t server_certificate_length,
WebContentDecryptionModuleResult result) { … }
void WebContentDecryptionModuleImpl::GetStatusForPolicy(
const WebString& min_hdcp_version_string,
WebContentDecryptionModuleResult result) { … }
std::unique_ptr<media::CdmContextRef>
WebContentDecryptionModuleImpl::GetCdmContextRef() { … }
media::CdmConfig WebContentDecryptionModuleImpl::GetCdmConfig() const { … }
}