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

Unified Diff: components/mime_util/mime_util.cc

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 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: components/mime_util/mime_util.cc
diff --git a/components/mime_util/mime_util.cc b/components/mime_util/mime_util.cc
index ef5e0daaefdda35a2bf2d616da5184fef1a76617..49bf49d40f776dc76b8cef075f99513403346562 100644
--- a/components/mime_util/mime_util.cc
+++ b/components/mime_util/mime_util.cc
@@ -161,10 +161,11 @@ bool MimeUtil::IsSupportedNonImageMimeType(const std::string& mime_type) const {
#if !defined(OS_IOS)
media::IsSupportedMediaMimeType(mime_type) ||
#endif
- (base::StartsWithASCII(mime_type, "text/",
- false /* case insensitive */) &&
+ (base::StartsWith(mime_type, "text/",
+ base::CompareCase::INSENSITIVE_ASCII) &&
!IsUnsupportedTextMimeType(mime_type)) ||
- (base::StartsWithASCII(mime_type, "application/", false) &&
+ (base::StartsWith(mime_type, "application/",
+ base::CompareCase::INSENSITIVE_ASCII) &&
net::MatchesMimeType("application/*+json", mime_type));
}
@@ -179,7 +180,8 @@ bool MimeUtil::IsSupportedJavascriptMimeType(
}
bool MimeUtil::IsSupportedMimeType(const std::string& mime_type) const {
- return (base::StartsWithASCII(mime_type, "image/", false) &&
+ return (base::StartsWith(mime_type, "image/",
+ base::CompareCase::INSENSITIVE_ASCII) &&
IsSupportedImageMimeType(mime_type)) ||
IsSupportedNonImageMimeType(mime_type);
}
« no previous file with comments | « components/invalidation/impl/gcm_network_channel_unittest.cc ('k') | components/nacl/renderer/ppb_nacl_private_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698