0

[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:
John Rummell
2023-06-01 23:46:02 +00:00
committed by Chromium LUCI CQ
parent 238f531c9f
commit 45cde43550
15 changed files with 130 additions and 83 deletions

@ -786,7 +786,7 @@ int BrowserMainLoop::PreCreateThreads() {
}
#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
// 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.
@ -1432,6 +1432,11 @@ void BrowserMainLoop::PostCreateThreadsImpl() {
#if BUILDFLAG(IS_ANDROID)
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)) {
FontUniqueNameLookup::GetInstance();
}