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

Unified Diff: net/base/mime_util.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: net/base/mime_util.cc
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc
index 500cdbab416b487e618b5c7e92d2cf8ff2fd7b2f..11da560a507958b0fca9e196f4a7ce6adbf86873 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>;
@@ -675,6 +677,22 @@ bool MimeUtil::IsSupportedStrictMediaMimeType(
AreSupportedCodecs(it->second, codecs);
}
+void MimeUtil::RemoveProprietaryMediaTypesAndCodecsForTests() {
+ // Unless/until WebM files are added to the media layout tests, we need to
+ // avoid removing 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)
+#if defined(GOOGLE_CHROME_BUILD) || defined(USE_PROPRIETARY_CODECS)
+ 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]);
+#endif
+#endif
+}
+
//----------------------------------------------------------------------------
// Wrappers for the singleton
//----------------------------------------------------------------------------
@@ -934,28 +952,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) {

Powered by Google App Engine
This is Rietveld 408576698