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

Unified Diff: mojo/services/html_viewer/webmimeregistry_impl.cc

Issue 815293002: Support unprefixed EME in HTMLViewer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 6 years 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 | « mojo/services/html_viewer/webmediaplayer_factory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/html_viewer/webmimeregistry_impl.cc
diff --git a/mojo/services/html_viewer/webmimeregistry_impl.cc b/mojo/services/html_viewer/webmimeregistry_impl.cc
index e7019db78c0ea83f9a43a5efb3c784f2a14641ca..c839610700e7188bd0acb5babd2cd2f2e2c77a98 100644
--- a/mojo/services/html_viewer/webmimeregistry_impl.cc
+++ b/mojo/services/html_viewer/webmimeregistry_impl.cc
@@ -8,6 +8,7 @@
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
+#include "media/base/key_systems.h"
#include "media/filters/stream_parser_factory.h"
#include "net/base/mime_util.h"
#include "third_party/WebKit/public/platform/WebString.h"
@@ -104,8 +105,24 @@ bool WebMimeRegistryImpl::supportsEncryptedMediaMIMEType(
const blink::WebString& key_system,
const blink::WebString& mime_type,
const blink::WebString& codecs) {
- NOTIMPLEMENTED();
- return false;
+ // Only supports ASCII parameters.
+ if (!base::IsStringASCII(key_system) || !base::IsStringASCII(mime_type) ||
+ !base::IsStringASCII(codecs)) {
+ return false;
+ }
+
+ if (key_system.isEmpty())
+ return false;
+
+ const std::string mime_type_ascii = base::UTF16ToASCII(mime_type);
+
+ std::vector<std::string> codec_vector;
+ bool strip_suffix = !net::IsStrictMediaMimeType(mime_type_ascii);
+ net::ParseCodecString(base::UTF16ToASCII(codecs), &codec_vector,
+ strip_suffix);
+
+ return media::IsSupportedKeySystemWithMediaMimeType(
+ mime_type_ascii, codec_vector, base::UTF16ToASCII(key_system));
}
blink::WebMimeRegistry::SupportsType
« no previous file with comments | « mojo/services/html_viewer/webmediaplayer_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698