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

Unified Diff: Source/core/loader/DocumentThreadableLoader.cpp

Issue 781673002: Use C++11 range-based loop for core/xml and core/loader (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remove unnecessary curly brackets Created 5 years, 11 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 | « Source/core/loader/CrossOriginPreflightResultCache.cpp ('k') | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/DocumentThreadableLoader.cpp
diff --git a/Source/core/loader/DocumentThreadableLoader.cpp b/Source/core/loader/DocumentThreadableLoader.cpp
index 1d33e697bb567eaab6372a833678aa1dbbb9b5f7..3c7ac1ba4338c819d01683ff92e5acd1a0f3dcb9 100644
--- a/Source/core/loader/DocumentThreadableLoader.cpp
+++ b/Source/core/loader/DocumentThreadableLoader.cpp
@@ -99,10 +99,9 @@ DocumentThreadableLoader::DocumentThreadableLoader(Document& document, Threadabl
// Save any CORS simple headers on the request here. If this request redirects cross-origin, we cancel the old request
// create a new one, and copy these headers.
const HTTPHeaderMap& headerMap = request.httpHeaderFields();
- HTTPHeaderMap::const_iterator end = headerMap.end();
- for (HTTPHeaderMap::const_iterator it = headerMap.begin(); it != end; ++it) {
- if (FetchUtils::isSimpleHeader(it->key, it->value))
- m_simpleRequestHeaders.add(it->key, it->value);
+ for (const auto& header : headerMap) {
+ if (FetchUtils::isSimpleHeader(header.key, header.value))
+ m_simpleRequestHeaders.add(header.key, header.value);
}
// If the fetch request will be handled by the ServiceWorker, the
@@ -319,10 +318,8 @@ void DocumentThreadableLoader::redirectReceived(Resource* resource, ResourceRequ
request.clearHTTPOrigin();
request.clearHTTPUserAgent();
// Add any CORS simple request headers which we previously saved from the original request.
- HTTPHeaderMap::const_iterator end = m_simpleRequestHeaders.end();
- for (HTTPHeaderMap::const_iterator it = m_simpleRequestHeaders.begin(); it != end; ++it) {
- request.setHTTPHeaderField(it->key, it->value);
- }
+ for (const auto& header : m_simpleRequestHeaders)
+ request.setHTTPHeaderField(header.key, header.value);
makeCrossOriginAccessRequest(request);
return;
}
« no previous file with comments | « Source/core/loader/CrossOriginPreflightResultCache.cpp ('k') | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698