Chromium Code Reviews| Index: net/base/mime_util.cc |
| diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc |
| index 7dd51a2945d4556a6ce45f858546e9c60ba8af69..e2b8d1cd93cd4262bbc0906010b79cd97770399f 100644 |
| --- a/net/base/mime_util.cc |
| +++ b/net/base/mime_util.cc |
| @@ -82,6 +82,7 @@ class MimeUtil : public PlatformMimeUtil { |
| bool IsSupportedImageMimeType(const std::string& mime_type) const; |
| bool IsSupportedMediaMimeType(const std::string& mime_type) const; |
| bool IsSupportedNonImageMimeType(const std::string& mime_type) const; |
| + bool IsSupportedImagePrefixedMimeType(const std::string& mime_type) const; |
| bool IsUnsupportedTextMimeType(const std::string& mime_type) const; |
| bool IsSupportedJavascriptMimeType(const std::string& mime_type) const; |
| @@ -727,6 +728,12 @@ bool MimeUtil::IsSupportedMimeType(const std::string& mime_type) const { |
| IsSupportedNonImageMimeType(mime_type); |
| } |
| +bool MimeUtil::IsSupportedImagePrefixedMimeType( |
| + const std::string& mime_type) const { |
| + return (mime_type.compare(0, 6, "image/") == 0 && |
| + (IsSupportedImageMimeType(mime_type) || |
| + IsSupportedNonImageMimeType(mime_type))); |
|
Ryan Sleevi
2014/08/22 23:08:35
This doesn't really make sense to me.
Ryan Sleevi
2014/08/23 05:09:45
What I specifically mean is that you check for the
|
| +} |
| // Tests for MIME parameter equality. Each parameter in the |mime_type_pattern| |
| // must be matched by a parameter in the |mime_type|. If there are no |
| // parameters in the pattern, the match is a success. |
| @@ -1080,6 +1087,10 @@ bool IsSupportedNonImageMimeType(const std::string& mime_type) { |
| return g_mime_util.Get().IsSupportedNonImageMimeType(mime_type); |
| } |
| +bool IsSupportedImagePrefixedMimeType(const std::string& mime_type) { |
| + return g_mime_util.Get().IsSupportedImagePrefixedMimeType(mime_type); |
| +} |
| + |
| bool IsUnsupportedTextMimeType(const std::string& mime_type) { |
| return g_mime_util.Get().IsUnsupportedTextMimeType(mime_type); |
| } |