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

Unified Diff: Source/core/loader/CrossOriginPreflightResultCache.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 | « no previous file | Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/CrossOriginPreflightResultCache.cpp
diff --git a/Source/core/loader/CrossOriginPreflightResultCache.cpp b/Source/core/loader/CrossOriginPreflightResultCache.cpp
index d4e85e39b7f17231cb99dd199d4225a1af0c91f5..2dab9c461346cc980d5c711066c82f90ce4514d1 100644
--- a/Source/core/loader/CrossOriginPreflightResultCache.cpp
+++ b/Source/core/loader/CrossOriginPreflightResultCache.cpp
@@ -122,10 +122,9 @@ bool CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod(const String&
bool CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders(const HTTPHeaderMap& requestHeaders, String& errorDescription) const
{
- HTTPHeaderMap::const_iterator end = requestHeaders.end();
- for (HTTPHeaderMap::const_iterator it = requestHeaders.begin(); it != end; ++it) {
- if (!m_headers.contains(it->key) && !FetchUtils::isSimpleHeader(it->key, it->value) && !FetchUtils::isForbiddenHeaderName(it->key)) {
- errorDescription = "Request header field " + it->key.string() + " is not allowed by Access-Control-Allow-Headers.";
+ for (const auto& header : requestHeaders) {
+ if (!m_headers.contains(header.key) && !FetchUtils::isSimpleHeader(header.key, header.value) && !FetchUtils::isForbiddenHeaderName(header.key)) {
+ errorDescription = "Request header field " + header.key.string() + " is not allowed by Access-Control-Allow-Headers.";
return false;
}
}
« no previous file with comments | « no previous file | Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698