#include "media/cdm/cdm_module.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "components/crash/core/common/crash_key.h"
#include "load_cdm_uma_helper.h"
#if BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION)
#include "base/feature_list.h"
#include "media/base/media_switches.h"
#include "media/cdm/cdm_host_files.h"
#endif
#define STRINGIFY(X) …
#define MAKE_STRING(X) …
namespace media {
namespace {
static CdmModule* g_cdm_module = …;
const char kUmaPrefix[] = …;
#if BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION)
void InitCdmHostVerification(
base::NativeLibrary cdm_library,
const base::FilePath& cdm_path,
const std::vector<CdmHostFilePath>& cdm_host_file_paths) {
DCHECK(cdm_library);
CdmHostFiles cdm_host_files;
cdm_host_files.Initialize(cdm_path, cdm_host_file_paths);
auto status = cdm_host_files.InitVerification(cdm_library);
UMA_HISTOGRAM_ENUMERATION("Media.EME.CdmHostVerificationStatus", status,
CdmHostFiles::Status::kStatusCount);
}
#endif
}
CdmModule* CdmModule::GetInstance() { … }
void CdmModule::ResetInstanceForTesting() { … }
CdmModule::CdmModule() = default;
CdmModule::~CdmModule() { … }
CdmModule::CreateCdmFunc CdmModule::GetCreateCdmFunc() { … }
#if BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION)
bool CdmModule::Initialize(const base::FilePath& cdm_path,
std::vector<CdmHostFilePath> cdm_host_file_paths) {
#else
bool CdmModule::Initialize(const base::FilePath& cdm_path) { … }
void CdmModule::InitializeCdmModule() { … }
}