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

Unified Diff: Source/core/inspector/InjectedScriptManager.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 and 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
« no previous file with comments | « Source/core/inspector/DOMPatchSupport.cpp ('k') | Source/core/inspector/InspectorCSSAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InjectedScriptManager.cpp
diff --git a/Source/core/inspector/InjectedScriptManager.cpp b/Source/core/inspector/InjectedScriptManager.cpp
index 14655542c0d867e64fd795242df37f4749de4560..680697dac0975794f2b5719571db9766ac1db25d 100644
--- a/Source/core/inspector/InjectedScriptManager.cpp
+++ b/Source/core/inspector/InjectedScriptManager.cpp
@@ -85,9 +85,9 @@ InjectedScript InjectedScriptManager::injectedScriptForId(int id)
IdToInjectedScriptMap::iterator it = m_idToInjectedScript.find(id);
if (it != m_idToInjectedScript.end())
return it->value;
- for (ScriptStateToId::iterator it = m_scriptStateToId.begin(); it != m_scriptStateToId.end(); ++it) {
- if (it->value == id)
- return injectedScriptFor(it->key.get());
+ for (auto& state : m_scriptStateToId) {
+ if (state.value == id)
+ return injectedScriptFor(state.key.get());
}
return InjectedScript();
}
@@ -139,8 +139,8 @@ void InjectedScriptManager::releaseObjectGroup(const String& objectGroup)
{
Vector<int> keys;
keys.appendRange(m_idToInjectedScript.keys().begin(), m_idToInjectedScript.keys().end());
- for (Vector<int>::iterator k = keys.begin(); k != keys.end(); ++k) {
- IdToInjectedScriptMap::iterator s = m_idToInjectedScript.find(*k);
+ for (auto& key : keys) {
+ IdToInjectedScriptMap::iterator s = m_idToInjectedScript.find(key);
if (s != m_idToInjectedScript.end())
s->value.releaseObjectGroup(objectGroup); // m_idToInjectedScript may change here.
}
« no previous file with comments | « Source/core/inspector/DOMPatchSupport.cpp ('k') | Source/core/inspector/InspectorCSSAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698