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(); |