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

Unified Diff: Source/core/fetch/FetchUtils.cpp

Issue 645513003: Use C++11 range-based loop in core/fetch (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: mike's comments Created 6 years, 2 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 | « no previous file | Source/core/fetch/ImageResource.cpp » ('j') | Source/core/fetch/ImageResource.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/FetchUtils.cpp
diff --git a/Source/core/fetch/FetchUtils.cpp b/Source/core/fetch/FetchUtils.cpp
index 86ad9bb0fa73bca0e8fa7fc4663c90195ead4fd8..e44443c7b2f73ec35442d28065e916ce76e4241f 100644
--- a/Source/core/fetch/FetchUtils.cpp
+++ b/Source/core/fetch/FetchUtils.cpp
@@ -107,11 +107,10 @@ bool FetchUtils::isSimpleRequest(const String& method, const HTTPHeaderMap& head
if (!isSimpleMethod(method))
return false;
- HTTPHeaderMap::const_iterator end = headerMap.end();
- for (HTTPHeaderMap::const_iterator it = headerMap.begin(); it != end; ++it) {
+ for (const auto& header : headerMap) {
// Preflight is required for MIME types that can not be sent via form
// submission.
- if (!isSimpleHeader(it->key, it->value))
+ if (!isSimpleHeader(header.key, header.value))
return false;
}
@@ -157,9 +156,8 @@ bool FetchUtils::isSimpleOrForbiddenRequest(const String& method, const HTTPHead
if (!isSimpleMethod(method))
return false;
- HTTPHeaderMap::const_iterator end = headerMap.end();
- for (HTTPHeaderMap::const_iterator it = headerMap.begin(); it != end; ++it) {
- if (!isSimpleHeader(it->key, it->value) && !isForbiddenHeaderName(it->key))
+ for (const auto& header : headerMap) {
+ if (!isSimpleHeader(header.key, header.value) && !isForbiddenHeaderName(header.key))
return false;
}
« no previous file with comments | « no previous file | Source/core/fetch/ImageResource.cpp » ('j') | Source/core/fetch/ImageResource.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698