Index: net/base/mime_util.cc |
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc |
index d3333c6ebe8fd11111f189d6d0ae13127d05e593..a4da640f04d8db8580e0a1a4f50d502b6427dba1 100644 |
--- a/net/base/mime_util.cc |
+++ b/net/base/mime_util.cc |
@@ -117,8 +117,7 @@ const char* FindMimeType(const MimeInfo* mappings, |
const char* extensions = mappings[i].extensions; |
for (;;) { |
size_t end_pos = strcspn(extensions, ","); |
- if (end_pos == ext_len && |
- base::strncasecmp(extensions, ext, ext_len) == 0) |
+ if (end_pos == ext_len && strncasecmp(extensions, ext, ext_len) == 0) |
return mappings[i].mime_type; |
extensions += end_pos; |
if (!*extensions) |
@@ -271,8 +270,8 @@ bool MimeUtil::MatchesMimeType(const std::string& mime_type_pattern, |
const std::string::size_type star = base_pattern.find('*'); |
if (star == std::string::npos) { |
if (base_pattern.size() == base_type.size() && |
- base::strncasecmp(base_pattern.c_str(), base_type.c_str(), |
- base_pattern.size()) == 0) { |
+ strncasecmp(base_pattern.c_str(), base_type.c_str(), |
+ base_pattern.size()) == 0) { |
return MatchesMimeTypeParameters(mime_type_pattern, mime_type); |
} else { |
return false; |
@@ -286,10 +285,11 @@ bool MimeUtil::MatchesMimeType(const std::string& mime_type_pattern, |
const std::string left(base_pattern.substr(0, star)); |
const std::string right(base_pattern.substr(star + 1)); |
- if (!StartsWithASCII(base_type, left, false)) |
+ if (!base::StartsWith(base_type, left, base::CompareCase::INSENSITIVE_ASCII)) |
return false; |
- if (!right.empty() && !EndsWith(base_type, right, false)) |
+ if (!right.empty() && |
+ !base::EndsWith(base_type, right, base::CompareCase::INSENSITIVE_ASCII)) |
return false; |
return MatchesMimeTypeParameters(mime_type_pattern, mime_type); |
@@ -333,7 +333,9 @@ bool MimeUtil::IsValidTopLevelMimeType(const std::string& type_string) const { |
return true; |
} |
- return type_string.size() > 2 && StartsWithASCII(type_string, "x-", false); |
+ return type_string.size() > 2 && |
+ base::StartsWith(type_string, "x-", |
+ base::CompareCase::INSENSITIVE_ASCII); |
} |
//---------------------------------------------------------------------------- |
@@ -460,7 +462,8 @@ void GetExtensionsFromHardCodedMappings( |
const std::string& leading_mime_type, |
base::hash_set<base::FilePath::StringType>* extensions) { |
for (size_t i = 0; i < mappings_len; ++i) { |
- if (StartsWithASCII(mappings[i].mime_type, leading_mime_type, false)) { |
+ if (base::StartsWith(mappings[i].mime_type, leading_mime_type, |
+ base::CompareCase::INSENSITIVE_ASCII)) { |
std::vector<string> this_extensions; |
base::SplitString(mappings[i].extensions, ',', &this_extensions); |
for (size_t j = 0; j < this_extensions.size(); ++j) { |
@@ -522,7 +525,7 @@ void GetExtensionsForMimeType( |
const std::string mime_type = base::StringToLowerASCII(unsafe_mime_type); |
base::hash_set<base::FilePath::StringType> unique_extensions; |
- if (EndsWith(mime_type, "/*", false)) { |
+ if (base::EndsWith(mime_type, "/*", base::CompareCase::INSENSITIVE_ASCII)) { |
std::string leading_mime_type = mime_type.substr(0, mime_type.length() - 1); |
// Find the matching StandardType from within kStandardTypes, or fall |