diff options
author | brettw <brettw@chromium.org> | 2015-07-15 23:48:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-16 06:48:41 +0000 |
commit | edce9a33027cc5f73c4866d70e34f690f6720a56 (patch) | |
tree | a8dbfae7b9ebf5a5cac2bb8a02f59b1637ddfa9c /components/devtools_http_handler/devtools_http_handler.cc | |
parent | fc4f1d1d95a221319f4c275e870e9b7cf2dc5040 (diff) | |
download | chromium_src-edce9a33027cc5f73c4866d70e34f690f6720a56.zip chromium_src-edce9a33027cc5f73c4866d70e34f690f6720a56.tar.gz chromium_src-edce9a33027cc5f73c4866d70e34f690f6720a56.tar.bz2 |
Remove some legacy versions of StartsWith and EndsWith.
This just replaces
true -> base::CompareCase::SENSITIVE
false -> base::CompareCase::INSENSITIVE_ASCII
I checked the insensitive cases to make sure they're not doing anything suspicious. The old version is a sometimes-correct Unicode comparison so converting to INSENSTITIVE_ASCII isn't a no-op. However, generally the prefix/suffix checking is done against a hardcoded string so there were very few cases to actually look at.
extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc has a not-quite search-and-replace change where I changed the type of a class variable.
BUG=506255
TBR=jam
Review URL: https://codereview.chromium.org/1239493005
Cr-Commit-Position: refs/heads/master@{#338996}
Diffstat (limited to 'components/devtools_http_handler/devtools_http_handler.cc')
-rw-r--r-- | components/devtools_http_handler/devtools_http_handler.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/components/devtools_http_handler/devtools_http_handler.cc b/components/devtools_http_handler/devtools_http_handler.cc index 0080f68..40f7edc 100644 --- a/components/devtools_http_handler/devtools_http_handler.cc +++ b/components/devtools_http_handler/devtools_http_handler.cc @@ -359,17 +359,22 @@ static std::string PathWithoutParams(const std::string& path) { } static std::string GetMimeType(const std::string& filename) { - if (base::EndsWith(filename, ".html", false)) { + if (base::EndsWith(filename, ".html", base::CompareCase::INSENSITIVE_ASCII)) { return "text/html"; - } else if (base::EndsWith(filename, ".css", false)) { + } else if (base::EndsWith(filename, ".css", + base::CompareCase::INSENSITIVE_ASCII)) { return "text/css"; - } else if (base::EndsWith(filename, ".js", false)) { + } else if (base::EndsWith(filename, ".js", + base::CompareCase::INSENSITIVE_ASCII)) { return "application/javascript"; - } else if (base::EndsWith(filename, ".png", false)) { + } else if (base::EndsWith(filename, ".png", + base::CompareCase::INSENSITIVE_ASCII)) { return "image/png"; - } else if (base::EndsWith(filename, ".gif", false)) { + } else if (base::EndsWith(filename, ".gif", + base::CompareCase::INSENSITIVE_ASCII)) { return "image/gif"; - } else if (base::EndsWith(filename, ".json", false)) { + } else if (base::EndsWith(filename, ".json", + base::CompareCase::INSENSITIVE_ASCII)) { return "application/json"; } LOG(ERROR) << "GetMimeType doesn't know mime type for: " |