0

media: Remove IsPotentiallySupportedKeySystem()

This function is no longer needed. It was used to filter out key systems
that were not known to Chromium and thus were not likely to be
implemented in an interoperable way. However, this has not been useful
in the past and is creating an exception to have key system specific
code in media/.

This change removes this function to make it easier to support other key
systems.

Bug: 378869813
Change-Id: Ic8303a43f2c5804f4e2b16836ae9bff0c518a511
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6056128
Auto-Submit: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Sangbaek Park <sangbaekpark@chromium.org>
Reviewed-by: John Rummell <jrummell@chromium.org>
Commit-Queue: Bo Liu <boliu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1391699}
This commit is contained in:
Xiaohan Wang
2024-12-04 16:16:56 +00:00
committed by Chromium LUCI CQ
parent 120339441e
commit 9b9e0a0bf1
3 changed files with 1 additions and 69 deletions
android_webview
javatests
src
org
chromium
android_webview
test
shell
res
media/base

@ -139,14 +139,6 @@ public class KeySystemTest extends AwParameterizedTest {
public void testSupportPlatformKeySystem() throws Throwable {
Assert.assertEquals(
getPlatformKeySystemExpectations(),
isKeySystemSupported("x-com.oem.test-keysystem"));
}
@Test
@Feature({"AndroidWebView"})
@SmallTest
public void testSupportPlatformKeySystemNoPrefix() throws Throwable {
Assert.assertEquals(
"\"NotSupportedError\"", isKeySystemSupported("com.oem.test-keysystem"));
isKeySystemSupported("com.oem.test-keysystem"));
}
}

@ -9,8 +9,6 @@
<string-array name="config_key_system_uuid_mapping" translatable="false">
<!-- Use Widevine's UUID to pass the availability-test of MediaDRM plugin -->
<!--suppress TypographyDashes -->
<item>"x-com.oem.test-keysystem,EDEF8BA9-79D6-4ACE-A3C8-27DCD51D21ED"</item>
<!--suppress TypographyDashes -->
<item>"com.oem.test-keysystem,EDEF8BA9-79D6-4ACE-A3C8-27DCD51D21ED"</item>
</string-array>
</resources>

@ -24,7 +24,6 @@
#include "media/base/mime_util.h"
#include "media/cdm/clear_key_cdm_common.h"
#include "media/media_buildflags.h"
#include "third_party/widevine/cdm/widevine_cdm_common.h"
namespace media {
@ -187,56 +186,6 @@ class ClearKeyKeySystemInfo : public KeySystemInfo {
bool UseAesDecryptor() const final { return true; }
};
// Returns whether the |key_system| is known to Chromium and is thus likely to
// be implemented in an interoperable way.
// True is always returned for a |key_system| that begins with "x-".
//
// As with other web platform features, advertising support for a key system
// implies that it adheres to a defined and interoperable specification.
//
// To ensure interoperability, implementations of a specific |key_system| string
// must conform to a specification for that identifier that defines
// key system-specific behaviors not fully defined by the EME specification.
// That specification should be provided by the owner of the domain that is the
// reverse of the |key_system| string.
// This involves more than calling a library, SDK, or platform API.
// KeySystemsImpl must be populated appropriately, and there will likely be glue
// code to adapt to the API of the library, SDK, or platform API.
//
// Chromium mainline contains this data and glue code for specific key systems,
// which should help ensure interoperability with other implementations using
// these key systems.
//
// If you need to add support for other key systems, ensure that you have
// obtained the specification for how to integrate it with EME, implemented the
// appropriate glue/adapter code, and added all the appropriate data to
// KeySystemsImpl. Only then should you change this function.
static bool IsPotentiallySupportedKeySystem(const std::string& key_system) {
if (key_system == kWidevineKeySystem)
return true;
if (key_system == kClearKeyKeySystem) {
return true;
}
// External or MediaFoundation Clear Key is known and supports suffixes for
// testing.
if (IsExternalClearKey(key_system))
return true;
// Chromecast defines behaviors for Cast clients within its reverse domain.
const char kChromecastRoot[] = "com.chromecast";
if (IsSubKeySystemOf(key_system, kChromecastRoot))
return true;
// Implementations that do not have a specification or appropriate glue code
// can use the "x-" prefix to avoid conflicting with and advertising support
// for real key system names. Use is discouraged.
const char kExcludedPrefix[] = "x-";
return base::StartsWith(key_system, kExcludedPrefix,
base::CompareCase::SENSITIVE);
}
// Returns whether distinctive identifiers and persistent state can be reliably
// blocked for |key_system_info| (and therefore be safely configurable).
static bool CanBlock(const KeySystemInfo& key_system_info) {
@ -391,13 +340,6 @@ void KeySystemsImpl::ProcessSupportedKeySystems(KeySystemInfos key_systems) {
DCHECK(key_system->GetDistinctiveIdentifierSupport() !=
EmeFeatureSupport::INVALID);
if (!IsPotentiallySupportedKeySystem(key_system->GetBaseKeySystemName())) {
// If you encounter this path, see the comments for the function above.
DLOG(ERROR) << "Unsupported name '" << key_system->GetBaseKeySystemName()
<< "'. See code comments.";
continue;
}
// Supporting persistent state is a prerequisite for supporting persistent
// sessions.
if (key_system->GetPersistentStateSupport() ==