summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-22 14:43:58 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-22 14:43:58 +0000
commita22282ccd0e22cb9882e66e53058c1fadf71219f (patch)
tree4a6f72ca545af1a8902a0f07678574b8519c9eaa /net
parentd1049d07f0cb04b1d1643e74c10122f9e5563ec7 (diff)
downloadchromium_src-a22282ccd0e22cb9882e66e53058c1fadf71219f.zip
chromium_src-a22282ccd0e22cb9882e66e53058c1fadf71219f.tar.gz
chromium_src-a22282ccd0e22cb9882e66e53058c1fadf71219f.tar.bz2
Shuffle media-related WebMimeRegistry code from webkit/ to content/.
TestShellWebMimeRegistryImpl has been replaced in lieu of content_shell calling net::RemoveProprietaryMediaTypesAndCodecsForTests(). BUG=251306 Review URL: https://chromiumcodereview.appspot.com/17447011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208045 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/mime_util.cc39
-rw-r--r--net/base/mime_util.h13
-rw-r--r--net/net.gyp5
3 files changed, 20 insertions, 37 deletions
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc
index 500cdba..da3a4c9 100644
--- a/net/base/mime_util.cc
+++ b/net/base/mime_util.cc
@@ -77,6 +77,8 @@ class MimeUtil : public PlatformMimeUtil {
const std::string& mime_type,
const std::vector<std::string>& codecs) const;
+ void RemoveProprietaryMediaTypesAndCodecsForTests();
+
private:
friend struct base::DefaultLazyInstanceTraits<MimeUtil>;
@@ -264,7 +266,7 @@ static const char* const common_media_types[] = {
// Ogg.
"audio/ogg",
"application/ogg",
-#if defined(ENABLE_MEDIA_CODEC_THEORA)
+#if !defined(OS_ANDROID) // Android doesn't support Ogg Theora.
"video/ogg",
#endif
@@ -300,7 +302,7 @@ static const char* const proprietary_media_types[] = {
// The codecs for WAV are integers as defined in Appendix A of RFC2361:
// http://tools.ietf.org/html/rfc2361
static const char* const common_media_codecs[] = {
-#if defined(ENABLE_MEDIA_CODEC_THEORA)
+#if !defined(OS_ANDROID) // Android doesn't support Ogg Theora.
"theora",
#endif
"vorbis",
@@ -675,6 +677,15 @@ bool MimeUtil::IsSupportedStrictMediaMimeType(
AreSupportedCodecs(it->second, codecs);
}
+void MimeUtil::RemoveProprietaryMediaTypesAndCodecsForTests() {
+ for (size_t i = 0; i < arraysize(proprietary_media_types); ++i) {
+ non_image_map_.erase(proprietary_media_types[i]);
+ media_map_.erase(proprietary_media_types[i]);
+ }
+ for (size_t i = 0; i < arraysize(proprietary_media_codecs); ++i)
+ codecs_map_.erase(proprietary_media_codecs[i]);
+}
+
//----------------------------------------------------------------------------
// Wrappers for the singleton
//----------------------------------------------------------------------------
@@ -934,28 +945,8 @@ void GetExtensionsForMimeType(
HashSetToVector(&unique_extensions, extensions);
}
-void GetMediaTypesBlacklistedForTests(std::vector<std::string>* types) {
- types->clear();
-
-// Unless/until WebM files are added to the media layout tests, we need to avoid
-// blacklisting mp4 and H.264 when Theora is not supported (and proprietary
-// codecs are) so that the media tests can still run.
-#if defined(ENABLE_MEDIA_CODEC_THEORA) || !defined(USE_PROPRIETARY_CODECS)
- for (size_t i = 0; i < arraysize(proprietary_media_types); ++i)
- types->push_back(proprietary_media_types[i]);
-#endif
-}
-
-void GetMediaCodecsBlacklistedForTests(std::vector<std::string>* codecs) {
- codecs->clear();
-
-// Unless/until WebM files are added to the media layout tests, we need to avoid
-// blacklisting mp4 and H.264 when Theora is not supported (and proprietary
-// codecs are) so that the media tests can still run.
-#if defined(ENABLE_MEDIA_CODEC_THEORA) || !defined(USE_PROPRIETARY_CODECS)
- for (size_t i = 0; i < arraysize(proprietary_media_codecs); ++i)
- codecs->push_back(proprietary_media_codecs[i]);
-#endif
+void RemoveProprietaryMediaTypesAndCodecsForTests() {
+ g_mime_util.Get().RemoveProprietaryMediaTypesAndCodecsForTests();
}
const std::string GetIANAMediaType(const std::string& mime_type) {
diff --git a/net/base/mime_util.h b/net/base/mime_util.h
index fc0999b..9662e96 100644
--- a/net/base/mime_util.h
+++ b/net/base/mime_util.h
@@ -94,14 +94,11 @@ NET_EXPORT void GetExtensionsForMimeType(
const std::string& mime_type,
std::vector<base::FilePath::StringType>* extensions);
-// Test only methods that return lists of proprietary media types and codecs
-// that are not supported by all variations of Chromium.
-// These types and codecs must be blacklisted to ensure consistent layout test
-// results across all Chromium variations.
-NET_EXPORT void GetMediaTypesBlacklistedForTests(
- std::vector<std::string>* types);
-NET_EXPORT void GetMediaCodecsBlacklistedForTests(
- std::vector<std::string>* codecs);
+// Test only method that removes proprietary media types and codecs from the
+// list of supported MIME types and codecs. These types and codecs must be
+// removed to ensure consistent layout test results across all Chromium
+// variations.
+NET_EXPORT void RemoveProprietaryMediaTypesAndCodecsForTests();
// Returns the IANA media type contained in |mime_type|, or an empty
// string if |mime_type| does not specifify a known media type.
diff --git a/net/net.gyp b/net/net.gyp
index 758419e..1d6d0d0 100644
--- a/net/net.gyp
+++ b/net/net.gyp
@@ -1414,11 +1414,6 @@
'include_dirs': [
'../third_party/openssl',
],
- }, { # else OS != "android"
- 'defines': [
- # These are the features Android doesn't support.
- 'ENABLE_MEDIA_CODEC_THEORA',
- ],
},
],
],