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

Unified Diff: webkit/glue/simple_webmimeregistry_impl.cc

Issue 17447011: Shuffle media-related WebMimeRegistry code from webkit/ to content/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 6 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 67fada65e02bd8df6af73077ae6ff712538b744d..a94e8bb2e53839b717817292e54b2f35d92f3bd7 100644
--- a/webkit/glue/simple_webmimeregistry_impl.cc
+++ b/webkit/glue/simple_webmimeregistry_impl.cc
@@ -7,27 +7,20 @@
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
-#include "media/filters/stream_parser_factory.h"
#include "net/base/mime_util.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "webkit/base/file_path_string_conversions.h"
-#include "webkit/renderer/media/crypto/key_systems.h"
using WebKit::WebString;
using WebKit::WebMimeRegistry;
-namespace {
+namespace webkit_glue {
-// Convert a WebString to ASCII, falling back on an empty string in the case
-// of a non-ASCII string.
-std::string ToASCIIOrEmpty(const WebString& string) {
+// static
+std::string SimpleWebMimeRegistryImpl::ToASCIIOrEmpty(const WebString& string) {
return IsStringASCII(string) ? UTF16ToASCII(string) : std::string();
}
-} // namespace
-
-namespace webkit_glue {
-
WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMIMEType(
const WebString& mime_type) {
return net::IsSupportedMimeType(ToASCIIOrEmpty(mime_type)) ?
@@ -47,76 +40,18 @@ 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& key_system) {
- const std::string mime_type_ascii = ToASCIIOrEmpty(mime_type);
- // Not supporting the container is a flat-out no.
- if (!net::IsSupportedMediaMimeType(mime_type_ascii))
- return IsNotSupported;
-
- if (!key_system.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 (!webkit_media::IsSupportedKeySystem(key_system))
- return IsNotSupported;
-
- std::vector<std::string> strict_codecs;
- bool strip_suffix = !net::IsStrictMediaMimeType(mime_type_ascii);
- net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, strip_suffix);
-
- if (!webkit_media::IsSupportedKeySystemWithMediaMimeType(
- mime_type_ascii, strict_codecs, ToASCIIOrEmpty(key_system)))
- return IsNotSupported;
-
- // Continue processing the mime_type and codecs.
- }
-
- // Check list of strict codecs to see if it is supported.
- if (net::IsStrictMediaMimeType(mime_type_ascii)) {
- // We support the container, but no codecs were specified.
- if (codecs.isNull())
- return MayBeSupported;
-
- // Check if the codecs are a perfect match.
- std::vector<std::string> strict_codecs;
- net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, false);
- if (!net::IsSupportedStrictMediaMimeType(mime_type_ascii, strict_codecs))
- return IsNotSupported;
-
- // Good to go!
- return IsSupported;
- }
-
- // If we don't recognize the codec, it's possible we support it.
- std::vector<std::string> parsed_codecs;
- net::ParseCodecString(ToASCIIOrEmpty(codecs), &parsed_codecs, true);
- if (!net::AreSupportedMediaCodecs(parsed_codecs))
- return MayBeSupported;
-
- // Otherwise we have a perfect match.
- return IsSupported;
+ const WebString& codecs) {
+ // Media features are only supported at the content/ layer.
+ return IsNotSupported;
}
bool SimpleWebMimeRegistryImpl::supportsMediaSourceMIMEType(
const WebKit::WebString& mime_type,
const WebString& codecs) {
- const std::string mime_type_ascii = ToASCIIOrEmpty(mime_type);
- std::vector<std::string> parsed_codec_ids;
- net::ParseCodecString(ToASCIIOrEmpty(codecs), &parsed_codec_ids, false);
- if (mime_type_ascii.empty() || parsed_codec_ids.size() == 0)
- return false;
- return media::StreamParserFactory::IsTypeSupported(
- mime_type_ascii, parsed_codec_ids);
+ // Media features are only supported at the content/ layer.
+ return false;
}
WebMimeRegistry::SupportsType

Powered by Google App Engine
This is Rietveld 408576698