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

Unified Diff: extensions/browser/api/web_request/web_request_api_helpers.cc

Issue 1282363003: Convert remaining StringToLowerASCII to ToLowerASCII (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « device/hid/hid_service_win.cc ('k') | extensions/browser/extension_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/web_request/web_request_api_helpers.cc
diff --git a/extensions/browser/api/web_request/web_request_api_helpers.cc b/extensions/browser/api/web_request/web_request_api_helpers.cc
index fb6908fd1c7bf1e65864e53e8f9c0252ec252658..fae5cdc212e2a38edaad011de1ad44b86ea16ee9 100644
--- a/extensions/browser/api/web_request/web_request_api_helpers.cc
+++ b/extensions/browser/api/web_request/web_request_api_helpers.cc
@@ -344,14 +344,12 @@ EventResponseDelta* CalculateOnHeadersReceivedDelta(
std::string name;
std::string value;
while (old_response_headers->EnumerateHeaderLines(&iter, &name, &value)) {
- std::string name_lowercase(name);
- base::StringToLowerASCII(&name_lowercase);
+ std::string name_lowercase = base::ToLowerASCII(name);
bool header_found = false;
- for (ResponseHeaders::const_iterator i = new_response_headers->begin();
- i != new_response_headers->end(); ++i) {
- if (base::LowerCaseEqualsASCII(i->first, name_lowercase.c_str()) &&
- value == i->second) {
+ for (const auto& i : *new_response_headers) {
+ if (base::LowerCaseEqualsASCII(i.first, name_lowercase) &&
+ value == i.second) {
header_found = true;
break;
}
@@ -1019,9 +1017,7 @@ void MergeCookiesInOnHeadersReceivedResponses(
// Converts the key of the (key, value) pair to lower case.
static ResponseHeader ToLowerCase(const ResponseHeader& header) {
- std::string lower_key(header.first);
- base::StringToLowerASCII(&lower_key);
- return ResponseHeader(lower_key, header.second);
+ return ResponseHeader(base::ToLowerASCII(header.first), header.second);
}
// Returns the extension ID of the first extension in |deltas| that removes the
@@ -1029,14 +1025,11 @@ static ResponseHeader ToLowerCase(const ResponseHeader& header) {
static std::string FindRemoveResponseHeader(
const EventResponseDeltas& deltas,
const std::string& key) {
- std::string lower_key = base::StringToLowerASCII(key);
- EventResponseDeltas::const_iterator delta;
- for (delta = deltas.begin(); delta != deltas.end(); ++delta) {
- ResponseHeaders::const_iterator i;
- for (i = (*delta)->deleted_response_headers.begin();
- i != (*delta)->deleted_response_headers.end(); ++i) {
- if (base::StringToLowerASCII(i->first) == lower_key)
- return (*delta)->extension_id;
+ std::string lower_key = base::ToLowerASCII(key);
+ for (const auto& delta : deltas) {
+ for (const auto& deleted_hdr : delta->deleted_response_headers) {
+ if (base::ToLowerASCII(deleted_hdr.first) == lower_key)
+ return delta->extension_id;
}
}
return std::string();
« no previous file with comments | « device/hid/hid_service_win.cc ('k') | extensions/browser/extension_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698