[Webview] Avoid old Android IPC used to check for key system support
Previously each renderer on Android would check for key system support by using cdm::QueryKeySystemSupport(), which uses the old IPC protocol. New way is to use the KeySystemSupport mojo interface where key systems are registered in the browser, and renderers subscribe to notifications. This matches what is being done for desktop browsers (and Chrome on Android). KeySystemSupport allows for delayed determination of what features are supported until the first time it is queried. So registration in the browser is done without specifying any capabilities, and they will be computed the first time they are needed. This also moves AddOtherAndroidKeySystems() into a separate file so that it can be reused for this change. Tested using WebView Browser Tester and playing videos from Widevine's integration site on a Pixel 4 and again on an Android emulator. Bug: 853336 Test: see above Change-Id: Ida12361fa8367f9644287d4ef95eb6a723034ab7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4368876 Reviewed-by: Xiaohan Wang <xhwang@chromium.org> Commit-Queue: John Rummell <jrummell@chromium.org> Reviewed-by: Nate Fischer <ntfschr@chromium.org> Reviewed-by: Nasko Oskov <nasko@chromium.org> Cr-Commit-Position: refs/heads/main@{#1152237}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
238f531c9f
commit
45cde43550
android_webview
browser
common
renderer
chrome/common/media
components/cdm
content/browser
@@ -57,7 +57,6 @@
|
|||||||
#include "base/task/sequenced_task_runner.h"
|
#include "base/task/sequenced_task_runner.h"
|
||||||
#include "base/task/thread_pool/thread_pool_instance.h"
|
#include "base/task/thread_pool/thread_pool_instance.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "components/cdm/browser/cdm_message_filter_android.h"
|
|
||||||
#include "components/crash/content/browser/crash_handler_host_linux.h"
|
#include "components/crash/content/browser/crash_handler_host_linux.h"
|
||||||
#include "components/embedder_support/origin_trials/origin_trials_settings_storage.h"
|
#include "components/embedder_support/origin_trials/origin_trials_settings_storage.h"
|
||||||
#include "components/embedder_support/switches.h"
|
#include "components/embedder_support/switches.h"
|
||||||
@@ -301,8 +300,6 @@ void AwContentBrowserClient::RenderProcessWillLaunch(
|
|||||||
host->GetID(), url::kContentScheme);
|
host->GetID(), url::kContentScheme);
|
||||||
|
|
||||||
host->AddFilter(new AwContentsMessageFilter(host->GetID()));
|
host->AddFilter(new AwContentsMessageFilter(host->GetID()));
|
||||||
// WebView always allows persisting data.
|
|
||||||
host->AddFilter(new cdm::CdmMessageFilterAndroid(true, false));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AwContentBrowserClient::IsExplicitNavigation(
|
bool AwContentBrowserClient::IsExplicitNavigation(
|
||||||
|
@@ -51,6 +51,7 @@ source_set("common") {
|
|||||||
"//ipc",
|
"//ipc",
|
||||||
"//mojo/public/cpp/bindings",
|
"//mojo/public/cpp/bindings",
|
||||||
"//skia",
|
"//skia",
|
||||||
|
"//third_party/widevine/cdm:buildflags",
|
||||||
"//ui/base",
|
"//ui/base",
|
||||||
"//ui/gfx/geometry",
|
"//ui/gfx/geometry",
|
||||||
"//ui/gfx/ipc/geometry",
|
"//ui/gfx/ipc/geometry",
|
||||||
|
@@ -7,4 +7,5 @@ include_rules = [
|
|||||||
"+components/gwp_asan/common/crash_key_name.h"
|
"+components/gwp_asan/common/crash_key_name.h"
|
||||||
"+components/printing/common",
|
"+components/printing/common",
|
||||||
"+media/base/android",
|
"+media/base/android",
|
||||||
|
"+third_party/widevine/cdm/buildflags.h",
|
||||||
]
|
]
|
||||||
|
@@ -14,14 +14,17 @@
|
|||||||
#include "base/functional/bind.h"
|
#include "base/functional/bind.h"
|
||||||
#include "base/no_destructor.h"
|
#include "base/no_destructor.h"
|
||||||
#include "base/task/sequenced_task_runner.h"
|
#include "base/task/sequenced_task_runner.h"
|
||||||
|
#include "components/cdm/common/android_cdm_registration.h"
|
||||||
#include "components/embedder_support/origin_trials/origin_trial_policy_impl.h"
|
#include "components/embedder_support/origin_trials/origin_trial_policy_impl.h"
|
||||||
#include "components/services/heap_profiling/public/cpp/profiling_client.h"
|
#include "components/services/heap_profiling/public/cpp/profiling_client.h"
|
||||||
#include "components/version_info/version_info.h"
|
#include "components/version_info/version_info.h"
|
||||||
|
#include "content/public/common/cdm_info.h"
|
||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
#include "gpu/config/gpu_info.h"
|
#include "gpu/config/gpu_info.h"
|
||||||
#include "gpu/config/gpu_util.h"
|
#include "gpu/config/gpu_util.h"
|
||||||
#include "mojo/public/cpp/bindings/binder_map.h"
|
#include "mojo/public/cpp/bindings/binder_map.h"
|
||||||
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
||||||
|
#include "third_party/widevine/cdm/buildflags.h"
|
||||||
#include "ui/base/l10n/l10n_util.h"
|
#include "ui/base/l10n/l10n_util.h"
|
||||||
#include "ui/base/resource/resource_bundle.h"
|
#include "ui/base/resource/resource_bundle.h"
|
||||||
|
|
||||||
@@ -68,6 +71,18 @@ void AwContentClient::SetGpuInfo(const gpu::GPUInfo& gpu_info) {
|
|||||||
gpu::SetKeysForCrashLogging(gpu_info);
|
gpu::SetKeysForCrashLogging(gpu_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AwContentClient::AddContentDecryptionModules(
|
||||||
|
std::vector<content::CdmInfo>* cdms,
|
||||||
|
std::vector<media::CdmHostFilePath>* cdm_host_file_paths) {
|
||||||
|
#if BUILDFLAG(ENABLE_WIDEVINE)
|
||||||
|
// Register Widevine.
|
||||||
|
cdm::AddAndroidWidevineCdm(cdms);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Register any other CDMs supported by the device.
|
||||||
|
cdm::AddOtherAndroidCdms(cdms);
|
||||||
|
}
|
||||||
|
|
||||||
bool AwContentClient::UsingSynchronousCompositing() {
|
bool AwContentClient::UsingSynchronousCompositing() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -34,6 +34,9 @@ class AwContentClient : public content::ContentClient {
|
|||||||
base::RefCountedMemory* GetDataResourceBytes(int resource_id) override;
|
base::RefCountedMemory* GetDataResourceBytes(int resource_id) override;
|
||||||
std::string GetDataResourceString(int resource_id) override;
|
std::string GetDataResourceString(int resource_id) override;
|
||||||
void SetGpuInfo(const gpu::GPUInfo& gpu_info) override;
|
void SetGpuInfo(const gpu::GPUInfo& gpu_info) override;
|
||||||
|
void AddContentDecryptionModules(
|
||||||
|
std::vector<content::CdmInfo>* cdms,
|
||||||
|
std::vector<media::CdmHostFilePath>* cdm_host_file_paths) override;
|
||||||
bool UsingSynchronousCompositing() override;
|
bool UsingSynchronousCompositing() override;
|
||||||
media::MediaDrmBridgeClient* GetMediaDrmBridgeClient() override;
|
media::MediaDrmBridgeClient* GetMediaDrmBridgeClient() override;
|
||||||
void ExposeInterfacesToBrowser(
|
void ExposeInterfacesToBrowser(
|
||||||
|
@@ -10,8 +10,6 @@ source_set("renderer") {
|
|||||||
"aw_content_renderer_client.h",
|
"aw_content_renderer_client.h",
|
||||||
"aw_content_settings_client.cc",
|
"aw_content_settings_client.cc",
|
||||||
"aw_content_settings_client.h",
|
"aw_content_settings_client.h",
|
||||||
"aw_key_systems.cc",
|
|
||||||
"aw_key_systems.h",
|
|
||||||
"aw_print_render_frame_helper_delegate.cc",
|
"aw_print_render_frame_helper_delegate.cc",
|
||||||
"aw_print_render_frame_helper_delegate.h",
|
"aw_print_render_frame_helper_delegate.h",
|
||||||
"aw_render_frame_ext.cc",
|
"aw_render_frame_ext.cc",
|
||||||
|
@@ -11,7 +11,6 @@
|
|||||||
#include "android_webview/common/mojom/frame.mojom.h"
|
#include "android_webview/common/mojom/frame.mojom.h"
|
||||||
#include "android_webview/common/url_constants.h"
|
#include "android_webview/common/url_constants.h"
|
||||||
#include "android_webview/renderer/aw_content_settings_client.h"
|
#include "android_webview/renderer/aw_content_settings_client.h"
|
||||||
#include "android_webview/renderer/aw_key_systems.h"
|
|
||||||
#include "android_webview/renderer/aw_print_render_frame_helper_delegate.h"
|
#include "android_webview/renderer/aw_print_render_frame_helper_delegate.h"
|
||||||
#include "android_webview/renderer/aw_render_frame_ext.h"
|
#include "android_webview/renderer/aw_render_frame_ext.h"
|
||||||
#include "android_webview/renderer/aw_render_view_ext.h"
|
#include "android_webview/renderer/aw_render_view_ext.h"
|
||||||
@@ -24,6 +23,7 @@
|
|||||||
#include "base/metrics/histogram_macros.h"
|
#include "base/metrics/histogram_macros.h"
|
||||||
#include "base/strings/string_util.h"
|
#include "base/strings/string_util.h"
|
||||||
#include "components/android_system_error_page/error_page_populator.h"
|
#include "components/android_system_error_page/error_page_populator.h"
|
||||||
|
#include "components/cdm/renderer/key_system_support_update.h"
|
||||||
#include "components/js_injection/renderer/js_communication.h"
|
#include "components/js_injection/renderer/js_communication.h"
|
||||||
#include "components/network_hints/renderer/web_prescient_networking_impl.h"
|
#include "components/network_hints/renderer/web_prescient_networking_impl.h"
|
||||||
#include "components/page_load_metrics/renderer/metrics_render_frame_observer.h"
|
#include "components/page_load_metrics/renderer/metrics_render_frame_observer.h"
|
||||||
@@ -214,9 +214,8 @@ void AwContentRendererClient::RunScriptsAtDocumentStart(
|
|||||||
|
|
||||||
void AwContentRendererClient::GetSupportedKeySystems(
|
void AwContentRendererClient::GetSupportedKeySystems(
|
||||||
media::GetSupportedKeySystemsCB cb) {
|
media::GetSupportedKeySystemsCB cb) {
|
||||||
media::KeySystemInfos key_systems;
|
// WebView always allows persisting data.
|
||||||
AwAddKeySystems(&key_systems);
|
cdm::GetSupportedKeySystemsUpdates(/*can_persist_data=*/true, std::move(cb));
|
||||||
std::move(cb).Run(std::move(key_systems));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<blink::WebSocketHandshakeThrottleProvider>
|
std::unique_ptr<blink::WebSocketHandshakeThrottleProvider>
|
||||||
|
@@ -1,17 +0,0 @@
|
|||||||
// Copyright 2013 The Chromium Authors
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#include "android_webview/renderer/aw_key_systems.h"
|
|
||||||
#include "components/cdm/renderer/android_key_systems.h"
|
|
||||||
|
|
||||||
namespace android_webview {
|
|
||||||
|
|
||||||
void AwAddKeySystems(media::KeySystemInfos* key_systems_infos) {
|
|
||||||
#if BUILDFLAG(ENABLE_WIDEVINE)
|
|
||||||
cdm::AddAndroidWidevine(key_systems_infos);
|
|
||||||
#endif // BUILDFLAG(ENABLE_WIDEVINE)
|
|
||||||
cdm::AddAndroidPlatformKeySystems(key_systems_infos);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace android_webview
|
|
@@ -1,16 +0,0 @@
|
|||||||
// Copyright 2013 The Chromium Authors
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef ANDROID_WEBVIEW_RENDERER_AW_KEY_SYSTEMS_H_
|
|
||||||
#define ANDROID_WEBVIEW_RENDERER_AW_KEY_SYSTEMS_H_
|
|
||||||
|
|
||||||
#include "media/base/key_system_info.h"
|
|
||||||
|
|
||||||
namespace android_webview {
|
|
||||||
|
|
||||||
void AwAddKeySystems(media::KeySystemInfos* key_system_infos);
|
|
||||||
|
|
||||||
} // namespace android_webview
|
|
||||||
|
|
||||||
#endif // ANDROID_WEBVIEW_RENDERER_AW_KEY_SYSTEMS_H_
|
|
@@ -48,7 +48,7 @@
|
|||||||
#endif // BUILDFLAG(ENABLE_WIDEVINE)
|
#endif // BUILDFLAG(ENABLE_WIDEVINE)
|
||||||
|
|
||||||
#if BUILDFLAG(IS_ANDROID)
|
#if BUILDFLAG(IS_ANDROID)
|
||||||
#include "media/base/android/media_drm_bridge.h"
|
#include "components/cdm/common/android_cdm_registration.h"
|
||||||
#endif // BUILDFLAG(IS_ANDROID)
|
#endif // BUILDFLAG(IS_ANDROID)
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -348,34 +348,6 @@ void AddMediaFoundationClearKey(std::vector<content::CdmInfo>* cdms) {
|
|||||||
}
|
}
|
||||||
#endif // BUILDFLAG(IS_WIN)
|
#endif // BUILDFLAG(IS_WIN)
|
||||||
|
|
||||||
#if BUILDFLAG(IS_ANDROID)
|
|
||||||
void AddOtherAndroidKeySystems(std::vector<content::CdmInfo>* cdms) {
|
|
||||||
// CdmInfo needs a CdmType, but on Android it is not used as the key system
|
|
||||||
// is supported by MediaDrm. Using a random value as something needs to be
|
|
||||||
// specified, but must be different than other CdmTypes specified.
|
|
||||||
// (On Android the key system is identified by UUID, and that mapping is
|
|
||||||
// maintained by MediaDrmBridge.)
|
|
||||||
const media::CdmType kAndroidCdmType{0x2e9dabb9c171c28cull,
|
|
||||||
0xf455252ec70b52adull};
|
|
||||||
|
|
||||||
// MediaDrmBridge returns a list of key systems available on the device
|
|
||||||
// that are not Widevine. Register them with no capabilities specified so
|
|
||||||
// that lazy evaluation can figure out what is supported when requested.
|
|
||||||
// We don't know if either software secure or hardware secure support is
|
|
||||||
// available, so register them both. Lazy evaluation will remove them
|
|
||||||
// if they aren't supported.
|
|
||||||
const auto key_system_names =
|
|
||||||
media::MediaDrmBridge::GetPlatformKeySystemNames();
|
|
||||||
for (const auto& key_system : key_system_names) {
|
|
||||||
DVLOG(3) << __func__ << " key_system:" << key_system;
|
|
||||||
cdms->push_back(content::CdmInfo(key_system, Robustness::kSoftwareSecure,
|
|
||||||
absl::nullopt, kAndroidCdmType));
|
|
||||||
cdms->push_back(content::CdmInfo(key_system, Robustness::kHardwareSecure,
|
|
||||||
absl::nullopt, kAndroidCdmType));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif // BUILDFLAG(IS_ANDROID)
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
void RegisterCdmInfo(std::vector<content::CdmInfo>* cdms) {
|
void RegisterCdmInfo(std::vector<content::CdmInfo>* cdms) {
|
||||||
@@ -396,7 +368,7 @@ void RegisterCdmInfo(std::vector<content::CdmInfo>* cdms) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BUILDFLAG(IS_ANDROID)
|
#if BUILDFLAG(IS_ANDROID)
|
||||||
AddOtherAndroidKeySystems(cdms);
|
cdm::AddOtherAndroidCdms(cdms);
|
||||||
#endif // BUILDFLAG(IS_ANDROID)
|
#endif // BUILDFLAG(IS_ANDROID)
|
||||||
|
|
||||||
DVLOG(3) << __func__ << " done with " << cdms->size() << " cdms";
|
DVLOG(3) << __func__ << " done with " << cdms->size() << " cdms";
|
||||||
|
@@ -5,5 +5,6 @@ include_rules = [
|
|||||||
"+media/cdm",
|
"+media/cdm",
|
||||||
"+media/media_buildflags.h",
|
"+media/media_buildflags.h",
|
||||||
"+ppapi/buildflags",
|
"+ppapi/buildflags",
|
||||||
|
"+third_party/widevine/cdm/buildflags.h",
|
||||||
"+third_party/widevine/cdm/widevine_cdm_common.h",
|
"+third_party/widevine/cdm/widevine_cdm_common.h",
|
||||||
]
|
]
|
||||||
|
@@ -10,16 +10,6 @@ static_library("common") {
|
|||||||
"cdm_message_generator.h",
|
"cdm_message_generator.h",
|
||||||
]
|
]
|
||||||
|
|
||||||
if (is_android) {
|
|
||||||
sources += [
|
|
||||||
"cdm_messages_android.h",
|
|
||||||
"clearkey_drm_delegate_android.cc",
|
|
||||||
"clearkey_drm_delegate_android.h",
|
|
||||||
"widevine_drm_delegate_android.cc",
|
|
||||||
"widevine_drm_delegate_android.h",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
"//base",
|
"//base",
|
||||||
"//content/public/common",
|
"//content/public/common",
|
||||||
@@ -27,6 +17,19 @@ static_library("common") {
|
|||||||
"//media",
|
"//media",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (is_android) {
|
||||||
|
sources += [
|
||||||
|
"android_cdm_registration.cc",
|
||||||
|
"android_cdm_registration.h",
|
||||||
|
"cdm_messages_android.h",
|
||||||
|
"clearkey_drm_delegate_android.cc",
|
||||||
|
"clearkey_drm_delegate_android.h",
|
||||||
|
"widevine_drm_delegate_android.cc",
|
||||||
|
"widevine_drm_delegate_android.h",
|
||||||
|
]
|
||||||
|
deps += [ "//third_party/widevine/cdm:buildflags" ]
|
||||||
|
}
|
||||||
|
|
||||||
if (enable_library_cdms) {
|
if (enable_library_cdms) {
|
||||||
sources += [
|
sources += [
|
||||||
"cdm_manifest.cc",
|
"cdm_manifest.cc",
|
||||||
|
59
components/cdm/common/android_cdm_registration.cc
Normal file
59
components/cdm/common/android_cdm_registration.cc
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
// Copyright 2023 The Chromium Authors
|
||||||
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
#include "components/cdm/common/android_cdm_registration.h"
|
||||||
|
|
||||||
|
#include "base/logging.h"
|
||||||
|
#include "media/base/android/media_drm_bridge.h"
|
||||||
|
#include "media/cdm/cdm_type.h"
|
||||||
|
|
||||||
|
#if BUILDFLAG(ENABLE_WIDEVINE)
|
||||||
|
#include "third_party/widevine/cdm/widevine_cdm_common.h" // nogncheck
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace cdm {
|
||||||
|
|
||||||
|
#if BUILDFLAG(ENABLE_WIDEVINE)
|
||||||
|
void AddAndroidWidevineCdm(std::vector<content::CdmInfo>* cdms) {
|
||||||
|
// Widevine is done by MediaDrm, and should be supported on all devices.
|
||||||
|
// Register Widevine without any capabilities so that it will be
|
||||||
|
// checked the first time it is used.
|
||||||
|
cdms->emplace_back(kWidevineKeySystem,
|
||||||
|
content::CdmInfo::Robustness::kSoftwareSecure,
|
||||||
|
absl::nullopt, kWidevineCdmType);
|
||||||
|
cdms->emplace_back(kWidevineKeySystem,
|
||||||
|
content::CdmInfo::Robustness::kHardwareSecure,
|
||||||
|
absl::nullopt, kWidevineCdmType);
|
||||||
|
}
|
||||||
|
#endif // BUILDFLAG(ENABLE_WIDEVINE)
|
||||||
|
|
||||||
|
void AddOtherAndroidCdms(std::vector<content::CdmInfo>* cdms) {
|
||||||
|
// CdmInfo needs a CdmType, but on Android it is not used as the key system
|
||||||
|
// is supported by MediaDrm. Using a random value as something needs to be
|
||||||
|
// specified, but must be different than other CdmTypes specified.
|
||||||
|
// (On Android the key system is identified by UUID, and that mapping is
|
||||||
|
// maintained by MediaDrmBridge.)
|
||||||
|
const media::CdmType kAndroidCdmType{0x2e9dabb9c171c28cull,
|
||||||
|
0xf455252ec70b52adull};
|
||||||
|
|
||||||
|
// MediaDrmBridge returns a list of key systems available on the device
|
||||||
|
// that are not Widevine. Register them with no capabilities specified so
|
||||||
|
// that lazy evaluation can figure out what is supported when requested.
|
||||||
|
// We don't know if either software secure or hardware secure support is
|
||||||
|
// available, so register them both. Lazy evaluation will remove them
|
||||||
|
// if they aren't supported.
|
||||||
|
const auto key_system_names =
|
||||||
|
media::MediaDrmBridge::GetPlatformKeySystemNames();
|
||||||
|
for (const auto& key_system : key_system_names) {
|
||||||
|
DVLOG(3) << __func__ << " key_system:" << key_system;
|
||||||
|
cdms->emplace_back(key_system,
|
||||||
|
content::CdmInfo::Robustness::kSoftwareSecure,
|
||||||
|
absl::nullopt, kAndroidCdmType);
|
||||||
|
cdms->emplace_back(key_system,
|
||||||
|
content::CdmInfo::Robustness::kHardwareSecure,
|
||||||
|
absl::nullopt, kAndroidCdmType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace cdm
|
26
components/cdm/common/android_cdm_registration.h
Normal file
26
components/cdm/common/android_cdm_registration.h
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
// Copyright 2023 The Chromium Authors
|
||||||
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
#ifndef COMPONENTS_CDM_COMMON_ANDROID_CDM_REGISTRATION_H_
|
||||||
|
#define COMPONENTS_CDM_COMMON_ANDROID_CDM_REGISTRATION_H_
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "content/public/common/cdm_info.h"
|
||||||
|
#include "third_party/widevine/cdm/buildflags.h"
|
||||||
|
|
||||||
|
namespace cdm {
|
||||||
|
|
||||||
|
#if BUILDFLAG(ENABLE_WIDEVINE)
|
||||||
|
// Add Widevine Content Decryption Module, if enabled.
|
||||||
|
void AddAndroidWidevineCdm(std::vector<content::CdmInfo>* cdms);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Add other platform-supported Widevine Content Decryption Modules which are
|
||||||
|
// not explicitly handled by Chrome.
|
||||||
|
void AddOtherAndroidCdms(std::vector<content::CdmInfo>* cdms);
|
||||||
|
|
||||||
|
} // namespace cdm
|
||||||
|
|
||||||
|
#endif // COMPONENTS_CDM_COMMON_ANDROID_CDM_REGISTRATION_H_
|
@@ -786,7 +786,7 @@ int BrowserMainLoop::PreCreateThreads() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BUILDFLAG(ENABLE_LIBRARY_CDMS) || BUILDFLAG(IS_ANDROID)
|
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||||
// Prior to any processing happening on the IO thread, we create the
|
// Prior to any processing happening on the IO thread, we create the
|
||||||
// CDM service as it is predominantly used from the IO thread. This must
|
// CDM service as it is predominantly used from the IO thread. This must
|
||||||
// be called on the main thread since it involves file path checks.
|
// be called on the main thread since it involves file path checks.
|
||||||
@@ -1432,6 +1432,11 @@ void BrowserMainLoop::PostCreateThreadsImpl() {
|
|||||||
|
|
||||||
#if BUILDFLAG(IS_ANDROID)
|
#if BUILDFLAG(IS_ANDROID)
|
||||||
media::SetMediaDrmBridgeClient(GetContentClient()->GetMediaDrmBridgeClient());
|
media::SetMediaDrmBridgeClient(GetContentClient()->GetMediaDrmBridgeClient());
|
||||||
|
|
||||||
|
// On Android this must be done after SetMediaDrmBridgeClient(). For Android
|
||||||
|
// all CDMs are part of the OS, so no file checks are involved.
|
||||||
|
CdmRegistry::GetInstance()->Init();
|
||||||
|
|
||||||
if (base::FeatureList::IsEnabled(features::kFontSrcLocalMatching)) {
|
if (base::FeatureList::IsEnabled(features::kFontSrcLocalMatching)) {
|
||||||
FontUniqueNameLookup::GetInstance();
|
FontUniqueNameLookup::GetInstance();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user