Chromium Code Reviews| 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) |
|
mmenke
2013/06/21 18:11:27
Why the change here?
mmenke
2013/06/21 18:12:19
I mean why are the ifdef's different than the old
scherkus (not reviewing)
2013/06/21 19:23:38
actually ... we don't need these because if the ty
|
| + 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) { |