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

Unified Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 401523002: Move media related mimetype functionality out of net/ and into media/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and add content/common/mime_util.h for realz Created 6 years, 5 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: content/renderer/renderer_webkitplatformsupport_impl.cc
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc
index 3c9197ad638f50af92a85dbb0109b21a81d60483..a5999265d3bb6e479fdc29d52b5ef53bb04ef7e2 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc
@@ -59,6 +59,7 @@
#include "ipc/ipc_sync_message_filter.h"
#include "media/audio/audio_output_device.h"
#include "media/base/audio_hardware_config.h"
+#include "media/base/mime_util.h"
#include "media/filters/stream_parser_factory.h"
#include "net/base/mime_util.h"
#include "net/base/net_util.h"
@@ -411,7 +412,7 @@ RendererWebKitPlatformSupportImpl::MimeRegistry::supportsMediaMIMEType(
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))
+ if (!media::IsSupportedMediaMimeType(mime_type_ascii))
return IsNotSupported;
if (!key_system.isEmpty()) {
@@ -424,7 +425,7 @@ RendererWebKitPlatformSupportImpl::MimeRegistry::supportsMediaMIMEType(
std::string key_system_ascii =
GetUnprefixedKeySystemName(base::UTF16ToASCII(key_system));
std::vector<std::string> strict_codecs;
- net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, true);
+ media::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, true);
if (!IsSupportedKeySystemWithMediaMimeType(
mime_type_ascii, strict_codecs, key_system_ascii)) {
@@ -435,18 +436,18 @@ RendererWebKitPlatformSupportImpl::MimeRegistry::supportsMediaMIMEType(
}
// Check list of strict codecs to see if it is supported.
- if (net::IsStrictMediaMimeType(mime_type_ascii)) {
+ if (media::IsStrictMediaMimeType(mime_type_ascii)) {
// Check if the codecs are a perfect match.
std::vector<std::string> strict_codecs;
- net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, false);
+ media::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, false);
return static_cast<WebMimeRegistry::SupportsType> (
- net::IsSupportedStrictMediaMimeType(mime_type_ascii, strict_codecs));
+ media::IsSupportedStrictMediaMimeType(mime_type_ascii, strict_codecs));
}
// 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))
+ media::ParseCodecString(ToASCIIOrEmpty(codecs), &parsed_codecs, true);
+ if (!media::AreSupportedMediaCodecs(parsed_codecs))
return MayBeSupported;
// Otherwise we have a perfect match.
@@ -459,7 +460,7 @@ RendererWebKitPlatformSupportImpl::MimeRegistry::supportsMediaSourceMIMEType(
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);
+ media::ParseCodecString(ToASCIIOrEmpty(codecs), &parsed_codec_ids, false);
if (mime_type_ascii.empty())
return false;
return media::StreamParserFactory::IsTypeSupported(
@@ -483,9 +484,9 @@ RendererWebKitPlatformSupportImpl::MimeRegistry::supportsEncryptedMediaMIMEType(
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);
+ bool strip_suffix = !media::IsStrictMediaMimeType(mime_type_ascii);
+ media::ParseCodecString(base::UTF16ToASCII(codecs), &codec_vector,
+ strip_suffix);
return IsSupportedKeySystemWithMediaMimeType(
mime_type_ascii, codec_vector, base::UTF16ToASCII(key_system));

Powered by Google App Engine
This is Rietveld 408576698