Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(608)

Unified Diff: third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp

Issue 2397543002: EME: Check capabilities provided only on success (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp b/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
index cccf1ca57a574753f64316221f16d1ea56b09ac4..8dbbaab2c612b043bf9e04f3e46b5a777bfb1ac2 100644
--- a/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
+++ b/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
@@ -129,7 +129,7 @@ class MediaKeySystemAccessInitializer final : public EncryptedMediaRequest {
// See http://crbug.com/605661.
void checkEmptyCodecs(const WebMediaKeySystemConfiguration&);
- // Log UseCounter if configuration does not have at least one of
+ // Log UseCounter if selected configuration does not have at least one of
// 'audioCapabilities' and 'videoCapabilities' non-empty.
// TODO(jrummell): Switch to deprecation message once we have data.
// See http://crbug.com/616233.
@@ -162,8 +162,6 @@ MediaKeySystemAccessInitializer::MediaKeySystemAccessInitializer(
webConfig.videoCapabilities =
convertCapabilities(config.videoCapabilities());
- checkCapabilitiesProvided(webConfig);
-
DCHECK(config.hasDistinctiveIdentifier());
webConfig.distinctiveIdentifier =
convertMediaKeysRequirement(config.distinctiveIdentifier());
@@ -196,6 +194,7 @@ MediaKeySystemAccessInitializer::MediaKeySystemAccessInitializer(
void MediaKeySystemAccessInitializer::requestSucceeded(
WebContentDecryptionModuleAccess* access) {
checkEmptyCodecs(access->getConfiguration());
+ checkCapabilitiesProvided(access->getConfiguration());
m_resolver->resolve(
new MediaKeySystemAccess(m_keySystem, wrapUnique(access)));
@@ -284,6 +283,9 @@ void MediaKeySystemAccessInitializer::checkEmptyCodecs(
void MediaKeySystemAccessInitializer::checkCapabilitiesProvided(
xhwang 2016/10/06 17:01:05 "provided" is a bit ambiguous..
jrummell 2016/10/06 18:43:04 Removed "Provided".
const WebMediaKeySystemConfiguration& config) {
+ // This is only checking that at least one capability is provided in the
+ // selected configuration, as apps may pass empty capabilities for
+ // compatibility with other implementations.
bool atLeastOneAudioCapability = config.audioCapabilities.size() > 0;
bool atLeastOneVideoCapability = config.videoCapabilities.size() > 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698