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

Unified Diff: webkit/glue/simple_webmimeregistry_impl.cc

Issue 10020053: Initial implementation of Encrypted Media Extensions in Chrome. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 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
Index: webkit/glue/simple_webmimeregistry_impl.cc
diff --git a/webkit/glue/simple_webmimeregistry_impl.cc b/webkit/glue/simple_webmimeregistry_impl.cc
index 1bc28fa17e933e54e635cf6147ac881487ce72c5..c95a1bbf81cc0e0a41d1a38b576bfa4d057c1378 100644
--- a/webkit/glue/simple_webmimeregistry_impl.cc
+++ b/webkit/glue/simple_webmimeregistry_impl.cc
@@ -10,9 +10,11 @@
#include "net/base/mime_util.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
#include "webkit/glue/webkit_glue.h"
+#include "webkit/media/supported_key_systems.h"
using WebKit::WebString;
using WebKit::WebMimeRegistry;
+using webkit_media::SupportedKeySystems;
namespace {
@@ -45,13 +47,42 @@ WebMimeRegistry::SupportsType
WebMimeRegistry::IsSupported : WebMimeRegistry::IsNotSupported;
}
+// When debugging layout tests failures in the test shell,
+// see TestShellWebMimeRegistryImpl.
+WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMediaMIMEType(
+ const WebString& mime_type, const WebString& codecs) {
+ return supportsMediaMIMEType(mime_type, codecs, WebString());
+}
+
WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMediaMIMEType(
const WebString& mime_type,
- const WebString& codecs) {
+ const WebString& codecs,
+ const WebString& keySystem) {
scherkus (not reviewing) 2012/04/12 20:18:41 key_system
ddorwin 2012/04/12 23:41:23 Done.
// Not supporting the container is a flat-out no.
if (!net::IsSupportedMediaMimeType(ToASCIIOrEmpty(mime_type)))
return IsNotSupported;
+ if (!keySystem.isEmpty()) {
+ // Check whether the key system is supported with the mime_type and codecs.
+
+ // Not supporting the key system is a flat-out no.
+ if (!SupportedKeySystems::isKeySystemSupported(keySystem))
+ return IsNotSupported;
+
+ std::vector<std::string> strict_codecs;
+ net::ParseCodecString(ToASCIIOrEmpty(codecs).c_str(),
scherkus (not reviewing) 2012/04/12 20:18:41 does this need to be c_str()? the calling function
ddorwin 2012/04/12 23:41:23 Done.
+ &strict_codecs,
+ false);
+
+ if (!SupportedKeySystems::IsSupportedKeySystemWithMediaMimeType(
+ ToASCIIOrEmpty(mime_type).c_str(),
scherkus (not reviewing) 2012/04/12 20:18:41 ditto here
ddorwin 2012/04/12 23:41:23 Done.
+ strict_codecs,
+ ToASCIIOrEmpty(keySystem).c_str()))
+ return IsNotSupported;
+
+ // Continue processing the mime_type and codecs.
+ }
+
// Check list of strict codecs to see if it is supported.
if (net::IsStrictMediaMimeType(ToASCIIOrEmpty(mime_type))) {
// We support the container, but no codecs were specified.

Powered by Google App Engine
This is Rietveld 408576698