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

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

Issue 2686133002: EME: Require codecs parameter for audio/videoCapabilities (Closed)
Patch Set: changes + additional test fixes Created 3 years, 10 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 | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | 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 ae354cf91d4200a796fc31befa4a430d520f1daf..4d66ba0a8c2a5f495a14e6f5ac1e676542c76b00 100644
--- a/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
+++ b/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
@@ -85,11 +85,6 @@ static WebVector<WebEncryptedMediaSessionType> convertSessionTypes(
return result;
}
-static bool AreCodecsSpecified(
- const WebMediaKeySystemMediaCapability& capability) {
- return !capability.codecs.isEmpty();
-}
-
// This class allows capabilities to be checked and a MediaKeySystemAccess
// object to be created asynchronously.
class MediaKeySystemAccessInitializer final : public EncryptedMediaRequest {
@@ -128,12 +123,6 @@ class MediaKeySystemAccessInitializer final : public EncryptedMediaRequest {
// robustness string.
void checkVideoCapabilityRobustness() const;
- // Generate deprecation warning and log UseCounter if configuration
- // contains only container-only contentType strings.
- // TODO(jrummell): Remove once this is no longer allowed.
- // See http://crbug.com/605661.
- void checkEmptyCodecs(const WebMediaKeySystemConfiguration&);
-
Member<ScriptPromiseResolver> m_resolver;
const String m_keySystem;
WebVector<WebMediaKeySystemConfiguration> m_supportedConfigurations;
@@ -199,8 +188,6 @@ SecurityOrigin* MediaKeySystemAccessInitializer::getSecurityOrigin() const {
void MediaKeySystemAccessInitializer::requestSucceeded(
WebContentDecryptionModuleAccess* access) {
- checkEmptyCodecs(access->getConfiguration());
-
if (!isExecutionContextValid())
return;
@@ -264,41 +251,6 @@ void MediaKeySystemAccessInitializer::checkVideoCapabilityRobustness() const {
}
}
-void MediaKeySystemAccessInitializer::checkEmptyCodecs(
- const WebMediaKeySystemConfiguration& config) {
- // This is only checking for empty codecs in the selected configuration,
- // as apps may pass container only contentType strings for compatibility
- // with other implementations.
- // This will only check that all returned capabilities do not contain
- // codecs. This avoids alerting on configurations that will continue
- // to succeed in the future once strict checking is enforced.
- bool areAllAudioCodecsEmpty = false;
- if (!config.audioCapabilities.isEmpty()) {
- areAllAudioCodecsEmpty =
- std::find_if(config.audioCapabilities.begin(),
- config.audioCapabilities.end(),
- AreCodecsSpecified) == config.audioCapabilities.end();
- }
-
- bool areAllVideoCodecsEmpty = false;
- if (!config.videoCapabilities.isEmpty()) {
- areAllVideoCodecsEmpty =
- std::find_if(config.videoCapabilities.begin(),
- config.videoCapabilities.end(),
- AreCodecsSpecified) == config.videoCapabilities.end();
- }
-
- if (areAllAudioCodecsEmpty || areAllVideoCodecsEmpty) {
- Deprecation::countDeprecation(
- m_resolver->getExecutionContext(),
- UseCounter::EncryptedMediaAllSelectedContentTypesMissingCodecs);
- } else {
- UseCounter::count(
- m_resolver->getExecutionContext(),
- UseCounter::EncryptedMediaAllSelectedContentTypesHaveCodecs);
- }
-}
-
} // namespace
ScriptPromise NavigatorRequestMediaKeySystemAccess::requestMediaKeySystemAccess(
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698