#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "media/mojo/mojom/content_decryption_module.mojom-blink.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/features.h"
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "mojo/public/cpp/bindings/urgent_message_scope.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
#include "media/mojo/mojom/content_decryption_module.mojom-params-data.h"
#include "media/mojo/mojom/content_decryption_module.mojom-shared-message-ids.h"
#include "media/mojo/mojom/content_decryption_module.mojom-blink-import-headers.h"
#include "media/mojo/mojom/content_decryption_module.mojom-blink-test-utils.h"
#include "mojo/public/cpp/bindings/lib/wtf_serialization.h"
namespace media::mojom::blink {
CdmPromiseResult::CdmPromiseResult()
: … { … }
CdmPromiseResult::CdmPromiseResult(
bool success_in,
CdmPromiseResult::Exception exception_in,
uint32_t system_code_in,
const WTF::String& error_message_in)
: … { … }
CdmPromiseResult::~CdmPromiseResult() = default;
size_t CdmPromiseResult::Hash(size_t seed) const { … }
void CdmPromiseResult::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool CdmPromiseResult::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
CdmKeyInformation::CdmKeyInformation()
: … { … }
CdmKeyInformation::CdmKeyInformation(
WTF::Vector<uint8_t> key_id_in,
CdmKeyStatus status_in,
uint32_t system_code_in)
: … { … }
CdmKeyInformation::~CdmKeyInformation() = default;
void CdmKeyInformation::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool CdmKeyInformation::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
CdmContext::CdmContext()
: … { … }
CdmContext::CdmContext(
const ::base::UnguessableToken& cdm_id_in,
::mojo::PendingRemote<::media::mojom::blink::Decryptor> decryptor_in)
: … { … }
CdmContext::~CdmContext() = default;
void CdmContext::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool CdmContext::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char ContentDecryptionModule::Name_[] = …;
ContentDecryptionModule::IPCStableHashFunction ContentDecryptionModule::MessageToMethodInfo_(mojo::Message& message) { … }
const char* ContentDecryptionModule::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t ContentDecryptionModule::SetClient_Sym::IPCStableHash() { … }
uint32_t ContentDecryptionModule::SetServerCertificate_Sym::IPCStableHash() { … }
uint32_t ContentDecryptionModule::GetStatusForPolicy_Sym::IPCStableHash() { … }
uint32_t ContentDecryptionModule::CreateSessionAndGenerateRequest_Sym::IPCStableHash() { … }
uint32_t ContentDecryptionModule::LoadSession_Sym::IPCStableHash() { … }
uint32_t ContentDecryptionModule::UpdateSession_Sym::IPCStableHash() { … }
uint32_t ContentDecryptionModule::CloseSession_Sym::IPCStableHash() { … }
uint32_t ContentDecryptionModule::RemoveSession_Sym::IPCStableHash() { … }
# endif
class ContentDecryptionModule_SetServerCertificate_ForwardToCallback
: public mojo::MessageReceiver { … };
class ContentDecryptionModule_GetStatusForPolicy_ForwardToCallback
: public mojo::MessageReceiver { … };
class ContentDecryptionModule_CreateSessionAndGenerateRequest_ForwardToCallback
: public mojo::MessageReceiver { … };
class ContentDecryptionModule_LoadSession_ForwardToCallback
: public mojo::MessageReceiver { … };
class ContentDecryptionModule_UpdateSession_ForwardToCallback
: public mojo::MessageReceiver { … };
class ContentDecryptionModule_CloseSession_ForwardToCallback
: public mojo::MessageReceiver { … };
class ContentDecryptionModule_RemoveSession_ForwardToCallback
: public mojo::MessageReceiver { … };
ContentDecryptionModuleProxy::ContentDecryptionModuleProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void ContentDecryptionModuleProxy::SetClient(
::mojo::PendingAssociatedRemote<ContentDecryptionModuleClient> in_client) { … }
void ContentDecryptionModuleProxy::SetServerCertificate(
const WTF::Vector<uint8_t>& in_certificate_data, SetServerCertificateCallback callback) { … }
void ContentDecryptionModuleProxy::GetStatusForPolicy(
HdcpVersion in_min_hdcp_version, GetStatusForPolicyCallback callback) { … }
void ContentDecryptionModuleProxy::CreateSessionAndGenerateRequest(
CdmSessionType in_session_type, EmeInitDataType in_init_data_type, const WTF::Vector<uint8_t>& in_init_data, CreateSessionAndGenerateRequestCallback callback) { … }
void ContentDecryptionModuleProxy::LoadSession(
CdmSessionType in_session_type, const WTF::String& in_session_id, LoadSessionCallback callback) { … }
void ContentDecryptionModuleProxy::UpdateSession(
const WTF::String& in_session_id, const WTF::Vector<uint8_t>& in_response, UpdateSessionCallback callback) { … }
void ContentDecryptionModuleProxy::CloseSession(
const WTF::String& in_session_id, CloseSessionCallback callback) { … }
void ContentDecryptionModuleProxy::RemoveSession(
const WTF::String& in_session_id, RemoveSessionCallback callback) { … }
class ContentDecryptionModule_SetServerCertificate_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool ContentDecryptionModule_SetServerCertificate_ForwardToCallback::Accept(
mojo::Message* message) { … }
void ContentDecryptionModule_SetServerCertificate_ProxyToResponder::Run(
CdmPromiseResultPtr in_result) { … }
class ContentDecryptionModule_GetStatusForPolicy_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool ContentDecryptionModule_GetStatusForPolicy_ForwardToCallback::Accept(
mojo::Message* message) { … }
void ContentDecryptionModule_GetStatusForPolicy_ProxyToResponder::Run(
CdmPromiseResultPtr in_result, CdmKeyStatus in_key_status) { … }
class ContentDecryptionModule_CreateSessionAndGenerateRequest_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool ContentDecryptionModule_CreateSessionAndGenerateRequest_ForwardToCallback::Accept(
mojo::Message* message) { … }
void ContentDecryptionModule_CreateSessionAndGenerateRequest_ProxyToResponder::Run(
CdmPromiseResultPtr in_result, const WTF::String& in_session_id) { … }
class ContentDecryptionModule_LoadSession_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool ContentDecryptionModule_LoadSession_ForwardToCallback::Accept(
mojo::Message* message) { … }
void ContentDecryptionModule_LoadSession_ProxyToResponder::Run(
CdmPromiseResultPtr in_result, const WTF::String& in_session_id) { … }
class ContentDecryptionModule_UpdateSession_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool ContentDecryptionModule_UpdateSession_ForwardToCallback::Accept(
mojo::Message* message) { … }
void ContentDecryptionModule_UpdateSession_ProxyToResponder::Run(
CdmPromiseResultPtr in_result) { … }
class ContentDecryptionModule_CloseSession_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool ContentDecryptionModule_CloseSession_ForwardToCallback::Accept(
mojo::Message* message) { … }
void ContentDecryptionModule_CloseSession_ProxyToResponder::Run(
CdmPromiseResultPtr in_result) { … }
class ContentDecryptionModule_RemoveSession_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool ContentDecryptionModule_RemoveSession_ForwardToCallback::Accept(
mojo::Message* message) { … }
void ContentDecryptionModule_RemoveSession_ProxyToResponder::Run(
CdmPromiseResultPtr in_result) { … }
bool ContentDecryptionModuleStubDispatch::Accept(
ContentDecryptionModule* impl,
mojo::Message* message) { … }
bool ContentDecryptionModuleStubDispatch::AcceptWithResponder(
ContentDecryptionModule* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kContentDecryptionModuleValidationInfo[] = …;
bool ContentDecryptionModuleRequestValidator::Accept(mojo::Message* message) { … }
bool ContentDecryptionModuleResponseValidator::Accept(mojo::Message* message) { … }
const char ContentDecryptionModuleClient::Name_[] = …;
ContentDecryptionModuleClient::IPCStableHashFunction ContentDecryptionModuleClient::MessageToMethodInfo_(mojo::Message& message) { … }
const char* ContentDecryptionModuleClient::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t ContentDecryptionModuleClient::OnSessionMessage_Sym::IPCStableHash() { … }
uint32_t ContentDecryptionModuleClient::OnSessionClosed_Sym::IPCStableHash() { … }
uint32_t ContentDecryptionModuleClient::OnSessionKeysChange_Sym::IPCStableHash() { … }
uint32_t ContentDecryptionModuleClient::OnSessionExpirationUpdate_Sym::IPCStableHash() { … }
# endif
ContentDecryptionModuleClientProxy::ContentDecryptionModuleClientProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void ContentDecryptionModuleClientProxy::OnSessionMessage(
const WTF::String& in_session_id, CdmMessageType in_message_type, const WTF::Vector<uint8_t>& in_message) { … }
void ContentDecryptionModuleClientProxy::OnSessionClosed(
const WTF::String& in_session_id, ::media::mojom::blink::CdmSessionClosedReason in_reason) { … }
void ContentDecryptionModuleClientProxy::OnSessionKeysChange(
const WTF::String& in_session_id, bool in_has_additional_usable_key, WTF::Vector<CdmKeyInformationPtr> in_keys_info) { … }
void ContentDecryptionModuleClientProxy::OnSessionExpirationUpdate(
const WTF::String& in_session_id, double in_new_expiry_time_sec) { … }
bool ContentDecryptionModuleClientStubDispatch::Accept(
ContentDecryptionModuleClient* impl,
mojo::Message* message) { … }
bool ContentDecryptionModuleClientStubDispatch::AcceptWithResponder(
ContentDecryptionModuleClient* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kContentDecryptionModuleClientValidationInfo[] = …;
bool ContentDecryptionModuleClientRequestValidator::Accept(mojo::Message* message) { … }
const char CdmFactory::Name_[] = …;
CdmFactory::IPCStableHashFunction CdmFactory::MessageToMethodInfo_(mojo::Message& message) { … }
const char* CdmFactory::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t CdmFactory::CreateCdm_Sym::IPCStableHash() { … }
# endif
class CdmFactory_CreateCdm_ForwardToCallback
: public mojo::MessageReceiver { … };
CdmFactoryProxy::CdmFactoryProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void CdmFactoryProxy::CreateCdm(
CdmConfigPtr in_cdm_config, CreateCdmCallback callback) { … }
class CdmFactory_CreateCdm_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool CdmFactory_CreateCdm_ForwardToCallback::Accept(
mojo::Message* message) { … }
void CdmFactory_CreateCdm_ProxyToResponder::Run(
::mojo::PendingRemote<ContentDecryptionModule> in_cdm, CdmContextPtr in_cdm_context, ::media::mojom::blink::CreateCdmStatus in_status) { … }
bool CdmFactoryStubDispatch::Accept(
CdmFactory* impl,
mojo::Message* message) { … }
bool CdmFactoryStubDispatch::AcceptWithResponder(
CdmFactory* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kCdmFactoryValidationInfo[] = …;
bool CdmFactoryRequestValidator::Accept(mojo::Message* message) { … }
bool CdmFactoryResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::media::mojom::blink::CdmPromiseResult::DataView, ::media::mojom::blink::CdmPromiseResultPtr>::Read(
::media::mojom::blink::CdmPromiseResult::DataView input,
::media::mojom::blink::CdmPromiseResultPtr* output) { … }
bool StructTraits<::media::mojom::blink::CdmKeyInformation::DataView, ::media::mojom::blink::CdmKeyInformationPtr>::Read(
::media::mojom::blink::CdmKeyInformation::DataView input,
::media::mojom::blink::CdmKeyInformationPtr* output) { … }
bool StructTraits<::media::mojom::blink::CdmContext::DataView, ::media::mojom::blink::CdmContextPtr>::Read(
::media::mojom::blink::CdmContext::DataView input,
::media::mojom::blink::CdmContextPtr* output) { … }
}
namespace media::mojom::blink {
void ContentDecryptionModuleInterceptorForTesting::SetClient(::mojo::PendingAssociatedRemote<ContentDecryptionModuleClient> client) { … }
void ContentDecryptionModuleInterceptorForTesting::SetServerCertificate(const WTF::Vector<uint8_t>& certificate_data, SetServerCertificateCallback callback) { … }
void ContentDecryptionModuleInterceptorForTesting::GetStatusForPolicy(HdcpVersion min_hdcp_version, GetStatusForPolicyCallback callback) { … }
void ContentDecryptionModuleInterceptorForTesting::CreateSessionAndGenerateRequest(CdmSessionType session_type, EmeInitDataType init_data_type, const WTF::Vector<uint8_t>& init_data, CreateSessionAndGenerateRequestCallback callback) { … }
void ContentDecryptionModuleInterceptorForTesting::LoadSession(CdmSessionType session_type, const WTF::String& session_id, LoadSessionCallback callback) { … }
void ContentDecryptionModuleInterceptorForTesting::UpdateSession(const WTF::String& session_id, const WTF::Vector<uint8_t>& response, UpdateSessionCallback callback) { … }
void ContentDecryptionModuleInterceptorForTesting::CloseSession(const WTF::String& session_id, CloseSessionCallback callback) { … }
void ContentDecryptionModuleInterceptorForTesting::RemoveSession(const WTF::String& session_id, RemoveSessionCallback callback) { … }
ContentDecryptionModuleAsyncWaiter::ContentDecryptionModuleAsyncWaiter(
ContentDecryptionModule* proxy) : … { … }
ContentDecryptionModuleAsyncWaiter::~ContentDecryptionModuleAsyncWaiter() = default;
void ContentDecryptionModuleAsyncWaiter::SetServerCertificate(
const WTF::Vector<uint8_t>& certificate_data, CdmPromiseResultPtr* out_result) { … }
CdmPromiseResultPtr ContentDecryptionModuleAsyncWaiter::SetServerCertificate(
const WTF::Vector<uint8_t>& certificate_data) { … }
void ContentDecryptionModuleAsyncWaiter::GetStatusForPolicy(
HdcpVersion min_hdcp_version, CdmPromiseResultPtr* out_result, CdmKeyStatus* out_key_status) { … }
void ContentDecryptionModuleAsyncWaiter::CreateSessionAndGenerateRequest(
CdmSessionType session_type, EmeInitDataType init_data_type, const WTF::Vector<uint8_t>& init_data, CdmPromiseResultPtr* out_result, WTF::String* out_session_id) { … }
void ContentDecryptionModuleAsyncWaiter::LoadSession(
CdmSessionType session_type, const WTF::String& session_id, CdmPromiseResultPtr* out_result, WTF::String* out_session_id) { … }
void ContentDecryptionModuleAsyncWaiter::UpdateSession(
const WTF::String& session_id, const WTF::Vector<uint8_t>& response, CdmPromiseResultPtr* out_result) { … }
CdmPromiseResultPtr ContentDecryptionModuleAsyncWaiter::UpdateSession(
const WTF::String& session_id, const WTF::Vector<uint8_t>& response) { … }
void ContentDecryptionModuleAsyncWaiter::CloseSession(
const WTF::String& session_id, CdmPromiseResultPtr* out_result) { … }
CdmPromiseResultPtr ContentDecryptionModuleAsyncWaiter::CloseSession(
const WTF::String& session_id) { … }
void ContentDecryptionModuleAsyncWaiter::RemoveSession(
const WTF::String& session_id, CdmPromiseResultPtr* out_result) { … }
CdmPromiseResultPtr ContentDecryptionModuleAsyncWaiter::RemoveSession(
const WTF::String& session_id) { … }
void ContentDecryptionModuleClientInterceptorForTesting::OnSessionMessage(const WTF::String& session_id, CdmMessageType message_type, const WTF::Vector<uint8_t>& message) { … }
void ContentDecryptionModuleClientInterceptorForTesting::OnSessionClosed(const WTF::String& session_id, ::media::mojom::blink::CdmSessionClosedReason reason) { … }
void ContentDecryptionModuleClientInterceptorForTesting::OnSessionKeysChange(const WTF::String& session_id, bool has_additional_usable_key, WTF::Vector<CdmKeyInformationPtr> keys_info) { … }
void ContentDecryptionModuleClientInterceptorForTesting::OnSessionExpirationUpdate(const WTF::String& session_id, double new_expiry_time_sec) { … }
ContentDecryptionModuleClientAsyncWaiter::ContentDecryptionModuleClientAsyncWaiter(
ContentDecryptionModuleClient* proxy) : … { … }
ContentDecryptionModuleClientAsyncWaiter::~ContentDecryptionModuleClientAsyncWaiter() = default;
void CdmFactoryInterceptorForTesting::CreateCdm(CdmConfigPtr cdm_config, CreateCdmCallback callback) { … }
CdmFactoryAsyncWaiter::CdmFactoryAsyncWaiter(
CdmFactory* proxy) : … { … }
CdmFactoryAsyncWaiter::~CdmFactoryAsyncWaiter() = default;
void CdmFactoryAsyncWaiter::CreateCdm(
CdmConfigPtr cdm_config, ::mojo::PendingRemote<ContentDecryptionModule>* out_cdm, CdmContextPtr* out_cdm_context, ::media::mojom::blink::CreateCdmStatus* out_status) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif