#include "third_party/blink/public/platform/media/web_encrypted_media_client_impl.h"
#include <memory>
#include <utility>
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
#include "base/no_destructor.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "media/base/key_systems.h"
#include "media/base/media_permission.h"
#include "third_party/blink/public/platform/web_content_decryption_module_result.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_security_origin.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/renderer/platform/media/web_content_decryption_module_access_impl.h"
#include "third_party/blink/renderer/platform/media/web_content_decryption_module_impl.h"
namespace blink {
namespace {
const char kKeySystemSupportUMAPrefix[] = …;
void CompleteWebContentDecryptionModuleResult(
std::unique_ptr<WebContentDecryptionModuleResult> result,
std::unique_ptr<WebContentDecryptionModule> cdm,
media::CreateCdmStatus status) { … }
}
struct UMAReportStatus { … };
class PerProcessReporter { … };
PerProcessReporterMap;
PerProcessReporterMap& GetPerProcessReporterMap() { … }
static PerProcessReporter* GetPerProcessReporter(const WebString& key_system) { … }
class WebEncryptedMediaClientImpl::Reporter { … };
WebEncryptedMediaClientImpl::WebEncryptedMediaClientImpl(
media::KeySystems* key_systems,
media::CdmFactory* cdm_factory,
media::MediaPermission* media_permission,
std::unique_ptr<KeySystemConfigSelector::WebLocalFrameDelegate>
web_frame_delegate)
: … { … }
WebEncryptedMediaClientImpl::~WebEncryptedMediaClientImpl() = default;
void WebEncryptedMediaClientImpl::RequestMediaKeySystemAccess(
WebEncryptedMediaRequest request) { … }
void WebEncryptedMediaClientImpl::CreateCdm(
const WebSecurityOrigin& security_origin,
const media::CdmConfig& cdm_config,
std::unique_ptr<WebContentDecryptionModuleResult> result) { … }
void WebEncryptedMediaClientImpl::OnKeySystemsUpdated() { … }
void WebEncryptedMediaClientImpl::SelectConfig(
WebEncryptedMediaRequest request) { … }
void WebEncryptedMediaClientImpl::OnConfigSelected(
WebEncryptedMediaRequest request,
KeySystemConfigSelector::Status status,
WebMediaKeySystemConfiguration* accumulated_configuration,
media::CdmConfig* cdm_config) { … }
WebEncryptedMediaClientImpl::Reporter* WebEncryptedMediaClientImpl::GetReporter(
const WebString& key_system) { … }
}