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

Unified Diff: Source/core/inspector/InspectorResourceContentLoader.cpp

Issue 800113002: Use C++11 range-based for loop in Source/core/inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: REBASE AGAIN! Created 6 years 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
Index: Source/core/inspector/InspectorResourceContentLoader.cpp
diff --git a/Source/core/inspector/InspectorResourceContentLoader.cpp b/Source/core/inspector/InspectorResourceContentLoader.cpp
index d919b17c04e08cd64e49cd05e3b2c6033700ac97..7ad21c9cd762e72520751d49cd1ed07ec40d430f 100644
--- a/Source/core/inspector/InspectorResourceContentLoader.cpp
+++ b/Source/core/inspector/InspectorResourceContentLoader.cpp
@@ -91,8 +91,8 @@ void InspectorResourceContentLoader::start()
documents.append(localFrame->document());
documents.appendVector(InspectorPageAgent::importsForFrame(localFrame));
}
- for (Vector<Document*>::const_iterator documentIt = documents.begin(); documentIt != documents.end(); ++documentIt) {
- Document* document = *documentIt;
+ for (const auto& documentIt : documents) {
+ Document* document = documentIt;
HashSet<String> urlsToFetch;
ResourceRequest resourceRequest;
@@ -120,8 +120,8 @@ void InspectorResourceContentLoader::start()
WillBeHeapVector<RawPtrWillBeMember<CSSStyleSheet> > styleSheets;
InspectorCSSAgent::collectAllDocumentStyleSheets(document, styleSheets);
- for (WillBeHeapVector<RawPtrWillBeMember<CSSStyleSheet> >::const_iterator stylesheetIt = styleSheets.begin(); stylesheetIt != styleSheets.end(); ++stylesheetIt) {
- CSSStyleSheet* styleSheet = *stylesheetIt;
+ for (const auto& stylesheetIt : styleSheets) {
+ CSSStyleSheet* styleSheet = stylesheetIt;
if (styleSheet->isInline() || !styleSheet->contents()->loadCompleted())
continue;
String url = styleSheet->baseURL().string();
@@ -173,8 +173,8 @@ void InspectorResourceContentLoader::stop()
{
HashSet<ResourceClient*> pendingResourceClients;
m_pendingResourceClients.swap(pendingResourceClients);
- for (HashSet<ResourceClient*>::const_iterator it = pendingResourceClients.begin(); it != pendingResourceClients.end(); ++it)
- (*it)->m_loader = 0;
+ for (const auto& it : pendingResourceClients)
+ it->m_loader = 0;
m_resources.clear();
// Make sure all callbacks are called to prevent infinite waiting time.
checkDone();
@@ -191,8 +191,8 @@ void InspectorResourceContentLoader::checkDone()
return;
PersistentHeapVectorWillBeHeapVector<Member<VoidCallback> > callbacks;
callbacks.swap(m_callbacks);
- for (PersistentHeapVectorWillBeHeapVector<Member<VoidCallback> >::const_iterator it = callbacks.begin(); it != callbacks.end(); ++it)
- (*it)->handleEvent();
+ for (const auto& it : callbacks)
+ it->handleEvent();
}
void InspectorResourceContentLoader::resourceFinished(ResourceClient* client)

Powered by Google App Engine
This is Rietveld 408576698