diff options
author | brettw <brettw@chromium.org> | 2015-08-11 12:30:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-11 19:31:27 +0000 |
commit | 8e2106dd88a61950569f9cfa8a94ad436d858658 (patch) | |
tree | b95818b8b8d98565bc0beaae50ffb76fa3d82080 /components | |
parent | 7d42dad6d95bf258c721f9d15f734bb9d0af8014 (diff) | |
download | chromium_src-8e2106dd88a61950569f9cfa8a94ad436d858658.zip chromium_src-8e2106dd88a61950569f9cfa8a94ad436d858658.tar.gz chromium_src-8e2106dd88a61950569f9cfa8a94ad436d858658.tar.bz2 |
Convert remaining StringToLowerASCII to ToLowerASCII.
Remove StringToLowerASCII. This removes the template and makes a consistent call that can take a string piece.
http_response_headers.cc in HttpResponseHeaders::RemoveHeaderLine there seemed to be a bug where it did
std::string old_header_name_lowercase(name);
where it actually meant
std::string old_header_name_lowercase(old_header_name);
I fixed this.
There were a number of cases where url.host() or url.scheme() was passed to ToLowerASCII. These are already guaranteed lower-case, so I removed the call.
There were a number of cases in net that did return ToLowerASCII().c_str() when the return type is a std::string, which is unnecessary and wasteful. I removed the c_str() call.
NOPRESUBMIT=true
(for touching code with wstrings)
Review URL: https://codereview.chromium.org/1282363003
Cr-Commit-Position: refs/heads/master@{#342869}
Diffstat (limited to 'components')
-rw-r--r-- | components/mime_util/mime_util.cc | 4 | ||||
-rw-r--r-- | components/storage_monitor/portable_device_watcher_win.cc | 2 | ||||
-rw-r--r-- | components/update_client/utils.cc | 2 | ||||
-rw-r--r-- | components/url_matcher/regex_set_matcher.cc | 3 |
4 files changed, 5 insertions, 6 deletions
diff --git a/components/mime_util/mime_util.cc b/components/mime_util/mime_util.cc index 6c51a9e..fa7471b 100644 --- a/components/mime_util/mime_util.cc +++ b/components/mime_util/mime_util.cc @@ -155,7 +155,7 @@ bool MimeUtil::IsSupportedImageMimeType(const std::string& mime_type) const { } bool MimeUtil::IsSupportedNonImageMimeType(const std::string& mime_type) const { - return non_image_types_.find(base::StringToLowerASCII(mime_type)) != + return non_image_types_.find(base::ToLowerASCII(mime_type)) != non_image_types_.end() || #if !defined(OS_IOS) media::IsSupportedMediaMimeType(mime_type) || @@ -169,7 +169,7 @@ bool MimeUtil::IsSupportedNonImageMimeType(const std::string& mime_type) const { } bool MimeUtil::IsUnsupportedTextMimeType(const std::string& mime_type) const { - return unsupported_text_types_.find(base::StringToLowerASCII(mime_type)) != + return unsupported_text_types_.find(base::ToLowerASCII(mime_type)) != unsupported_text_types_.end(); } diff --git a/components/storage_monitor/portable_device_watcher_win.cc b/components/storage_monitor/portable_device_watcher_win.cc index 0d2e5a8..b57f80a 100644 --- a/components/storage_monitor/portable_device_watcher_win.cc +++ b/components/storage_monitor/portable_device_watcher_win.cc @@ -60,7 +60,7 @@ base::string16 GetPnpDeviceId(LPARAM data) { return base::string16(); base::string16 device_id(dev_interface->dbcc_name); DCHECK(base::IsStringASCII(device_id)); - return base::StringToLowerASCII(device_id); + return base::ToLowerASCII(device_id); } // Gets the friendly name of the device specified by the |pnp_device_id|. On diff --git a/components/update_client/utils.cc b/components/update_client/utils.cc index 11e8060..2b66050 100644 --- a/components/update_client/utils.cc +++ b/components/update_client/utils.cc @@ -188,7 +188,7 @@ bool DeleteFileAndEmptyParentDirectory(const base::FilePath& filepath) { std::string GetCrxComponentID(const CrxComponent& component) { const size_t kCrxIdSize = 16; CHECK_GE(component.pk_hash.size(), kCrxIdSize); - return HexStringToID(base::StringToLowerASCII( + return HexStringToID(base::ToLowerASCII( base::HexEncode(&component.pk_hash[0], kCrxIdSize))); } diff --git a/components/url_matcher/regex_set_matcher.cc b/components/url_matcher/regex_set_matcher.cc index 1b0b7f3..ae994db 100644 --- a/components/url_matcher/regex_set_matcher.cc +++ b/components/url_matcher/regex_set_matcher.cc @@ -47,8 +47,7 @@ bool RegexSetMatcher::Match(const std::string& text, // FilteredRE2 expects lowercase for prefiltering, but we still // match case-sensitively. - std::vector<RE2ID> atoms(FindSubstringMatches( - base::StringToLowerASCII(text))); + std::vector<RE2ID> atoms(FindSubstringMatches(base::ToLowerASCII(text))); std::vector<RE2ID> re2_ids; filtered_re2_->AllMatches(text, atoms, &re2_ids); |