From 5dc3a3fb5e3286a9643fece7c7f94cec7fc29f3e Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Sat, 4 Sep 2021 11:31:59 +0200 Subject: Adaptations for Chromium 92 Change-Id: I1849c130ca75615802744275f6e4212a755c39b4 Reviewed-by: Michal Klocek --- src/core/content_client_qt.cpp | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'src/core/content_client_qt.cpp') diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp index ed98dd48d..100d3eae0 100644 --- a/src/core/content_client_qt.cpp +++ b/src/core/content_client_qt.cpp @@ -90,6 +90,8 @@ const char kPdfPluginMimeType[] = "application/x-google-chrome-pdf"; const char kPdfPluginPath[] = "internal-pdf-viewer"; #endif // QT_CONFIG(webengine_printing_and_pdf) +using Robustness = content::CdmInfo::Robustness; + static QString webenginePluginsPath() { // Look for plugins in /plugins/webengine or application dir. @@ -184,7 +186,7 @@ namespace QtWebEngineCore { #if defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT) static bool IsWidevineAvailable(base::FilePath *cdm_path, - content::CdmCapability *capability) + media::CdmCapability *capability) { QStringList pluginPaths; const base::CommandLine::StringType widevine_argument = base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(switches::kCdmWidevinePath); @@ -298,12 +300,12 @@ void ContentClientQt::AddContentDecryptionModules(std::vector if (cdms) { #if defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT) base::FilePath cdm_path; - content::CdmCapability capability; + media::CdmCapability capability; if (IsWidevineAvailable(&cdm_path, &capability)) { const base::Version version; - cdms->push_back(content::CdmInfo(kWidevineCdmDisplayName, kWidevineCdmGuid, version, cdm_path, - kWidevineCdmFileSystemId, std::move(capability), - kWidevineKeySystem, false)); + cdms->push_back(content::CdmInfo(kWidevineKeySystem, Robustness::kSoftwareSecure, std::move(capability), + /*supports_sub_key_systems=*/false, kWidevineCdmDisplayName, + kWidevineCdmGuid, version, cdm_path, kWidevineCdmFileSystemId)); } #endif // defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT) @@ -321,8 +323,8 @@ void ContentClientQt::AddContentDecryptionModules(std::vector "org.chromium.externalclearkey.differentguid"; // Supported codecs are hard-coded in ExternalClearKeyProperties. - content::CdmCapability capability( - {}, {media::EncryptionScheme::kCenc, media::EncryptionScheme::kCbcs}, + media::CdmCapability capability( + {}, {}, {media::EncryptionScheme::kCenc, media::EncryptionScheme::kCbcs}, {media::CdmSessionType::kTemporary, media::CdmSessionType::kPersistentLicense}); @@ -330,16 +332,17 @@ void ContentClientQt::AddContentDecryptionModules(std::vector // Otherwise, it'll be treated as a sub-key-system of normal // kExternalClearKeyKeySystem. See MultipleCdmTypes test in // ECKEncryptedMediaTest. - cdms->push_back(content::CdmInfo(media::kClearKeyCdmDisplayName, media::kClearKeyCdmDifferentGuid, - base::Version("0.1.0.0"), clear_key_cdm_path, - media::kClearKeyCdmFileSystemId, capability, - kExternalClearKeyDifferentGuidTestKeySystem, false)); - - // Supported codecs are hard-coded in ExternalClearKeyProperties. - cdms->push_back(content::CdmInfo(media::kClearKeyCdmDisplayName, media::kClearKeyCdmGuid, - base::Version("0.1.0.0"), clear_key_cdm_path, - media::kClearKeyCdmFileSystemId, capability, - kExternalClearKeyKeySystem, true)); + cdms->push_back(content::CdmInfo(kExternalClearKeyDifferentGuidTestKeySystem, + Robustness::kSoftwareSecure, capability, + /*supports_sub_key_systems=*/false, media::kClearKeyCdmDisplayName, + media::kClearKeyCdmDifferentGuid, base::Version("0.1.0.0"), + clear_key_cdm_path, media::kClearKeyCdmFileSystemId)); + + cdms->push_back(content::CdmInfo(kExternalClearKeyKeySystem, + Robustness::kSoftwareSecure, capability, + /*supports_sub_key_systems=*/true, media::kClearKeyCdmDisplayName, + media::kClearKeyCdmGuid, base::Version("0.1.0.0"), + clear_key_cdm_path, media::kClearKeyCdmFileSystemId)); } #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) } -- cgit v1.2.3