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

Unified Diff: Source/platform/MIMETypeRegistry.cpp

Issue 122743002: MIME type predicates and case-insensitive matching. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Simplify check for empty +xml subtype Created 6 years, 12 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
« no previous file with comments | « Source/core/xml/XMLHttpRequest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/MIMETypeRegistry.cpp
diff --git a/Source/platform/MIMETypeRegistry.cpp b/Source/platform/MIMETypeRegistry.cpp
index df2428cb313f8ed54b3dd91a412bc471dedb66b5..a6fa1947e7b6d60ffccf227c4932bbedfa5aee0f 100644
--- a/Source/platform/MIMETypeRegistry.cpp
+++ b/Source/platform/MIMETypeRegistry.cpp
@@ -69,7 +69,7 @@ String MIMETypeRegistry::getMIMETypeForPath(const String& path)
bool MIMETypeRegistry::isSupportedImageMIMEType(const String& mimeType)
{
- return blink::Platform::current()->mimeRegistry()->supportsImageMIMEType(mimeType)
+ return blink::Platform::current()->mimeRegistry()->supportsImageMIMEType(mimeType.lower())
!= blink::WebMimeRegistry::IsNotSupported;
}
@@ -80,29 +80,29 @@ bool MIMETypeRegistry::isSupportedImageResourceMIMEType(const String& mimeType)
bool MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(const String& mimeType)
{
- if (mimeType == "image/jpeg" || mimeType == "image/png")
+ if (equalIgnoringCase(mimeType, "image/jpeg") || equalIgnoringCase(mimeType, "image/png"))
return true;
- if (mimeType == "image/webp")
+ if (equalIgnoringCase(mimeType, "image/webp"))
return true;
return false;
}
bool MIMETypeRegistry::isSupportedJavaScriptMIMEType(const String& mimeType)
{
- return blink::Platform::current()->mimeRegistry()->supportsJavaScriptMIMEType(mimeType)
+ return blink::Platform::current()->mimeRegistry()->supportsJavaScriptMIMEType(mimeType.lower())
!= blink::WebMimeRegistry::IsNotSupported;
}
bool MIMETypeRegistry::isSupportedNonImageMIMEType(const String& mimeType)
{
- return blink::Platform::current()->mimeRegistry()->supportsNonImageMIMEType(mimeType)
+ return blink::Platform::current()->mimeRegistry()->supportsNonImageMIMEType(mimeType.lower())
!= blink::WebMimeRegistry::IsNotSupported;
}
bool MIMETypeRegistry::isSupportedMediaSourceMIMEType(const String& mimeType, const String& codecs)
{
return !mimeType.isEmpty()
- && blink::Platform::current()->mimeRegistry()->supportsMediaSourceMIMEType(mimeType, codecs);
+ && blink::Platform::current()->mimeRegistry()->supportsMediaSourceMIMEType(mimeType.lower(), codecs);
}
bool MIMETypeRegistry::isJavaAppletMIMEType(const String& mimeType)
« no previous file with comments | « Source/core/xml/XMLHttpRequest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698