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

Unified Diff: Source/core/frame/csp/ContentSecurityPolicy.cpp

Issue 642293004: Use C++11 range-based loop in core/frame (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use meaningful names 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
« Source/core/frame/FrameView.cpp ('K') | « Source/core/frame/LocalFrame.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/csp/ContentSecurityPolicy.cpp
diff --git a/Source/core/frame/csp/ContentSecurityPolicy.cpp b/Source/core/frame/csp/ContentSecurityPolicy.cpp
index a80f8ad21d7e8edfa3e22cae750b74f792e26854..625690416d6d41ef1f23de2cf13d2b40746702fa 100644
--- a/Source/core/frame/csp/ContentSecurityPolicy.cpp
+++ b/Source/core/frame/csp/ContentSecurityPolicy.cpp
@@ -164,12 +164,12 @@ void ContentSecurityPolicy::applyPolicySideEffectsToExecutionContext()
if (didSetReferrerPolicy())
document->setReferrerPolicy(m_referrerPolicy);
- for (ConsoleMessageVector::const_iterator iter = m_consoleMessages.begin(); iter != m_consoleMessages.end(); ++iter)
- m_executionContext->addConsoleMessage(*iter);
+ for (const auto& consoleMessage : m_consoleMessages)
+ m_executionContext->addConsoleMessage(consoleMessage);
m_consoleMessages.clear();
- for (CSPDirectiveListVector::const_iterator iter = m_policies.begin(); iter != m_policies.end(); ++iter)
- UseCounter::count(*document, getUseCounterType((*iter)->headerType()));
+ for (const auto& cspDirective : m_policies)
+ UseCounter::count(*document, getUseCounterType(cspDirective->headerType()));
}
// We disable 'eval()' even in the case of report-only policies, and rely on the check in the
@@ -191,8 +191,8 @@ Document* ContentSecurityPolicy::document() const
void ContentSecurityPolicy::copyStateFrom(const ContentSecurityPolicy* other)
{
ASSERT(m_policies.isEmpty());
- for (CSPDirectiveListVector::const_iterator iter = other->m_policies.begin(); iter != other->m_policies.end(); ++iter)
- addPolicyFromHeaderValue((*iter)->header(), (*iter)->headerType(), (*iter)->headerSource());
+ for (const auto& cspDirective : other->m_policies)
+ addPolicyFromHeaderValue(cspDirective->header(), cspDirective->headerType(), cspDirective->headerSource());
}
void ContentSecurityPolicy::didReceiveHeaders(const ContentSecurityPolicyResponseHeaders& headers)
« Source/core/frame/FrameView.cpp ('K') | « Source/core/frame/LocalFrame.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698