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

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

Issue 256743005: Add removeAll method to sets and maps and use them (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moved implementation of removeAll to HashTable.h and shared it. Also added it to LinkedHashSet Created 6 years, 8 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 | « Source/core/fetch/ResourceLoadPriorityOptimizer.cpp ('k') | Source/core/inspector/PageRuntimeAgent.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 1c410d697e999efe046ba1f9eac4928815f38e0a..83cd125fd109c82ab8ff0337b88fc22ed53e13d7 100644
--- a/Source/core/inspector/InjectedScriptManager.cpp
+++ b/Source/core/inspector/InjectedScriptManager.cpp
@@ -127,9 +127,7 @@ void InjectedScriptManager::discardInjectedScriptsFor(DOMWindow* window)
m_scriptStateToId.remove(scriptState);
idsToRemove.append(it->key);
}
-
- for (size_t i = 0; i < idsToRemove.size(); i++)
- m_idToInjectedScript.remove(idsToRemove[i]);
+ m_idToInjectedScript.removeAll(idsToRemove);
// Now remove script states that have id but no injected script.
Vector<NewScriptState*> scriptStatesToRemove;
@@ -138,8 +136,7 @@ void InjectedScriptManager::discardInjectedScriptsFor(DOMWindow* window)
if (window == scriptState->domWindow())
scriptStatesToRemove.append(scriptState);
}
- for (size_t i = 0; i < scriptStatesToRemove.size(); i++)
- m_scriptStateToId.remove(scriptStatesToRemove[i]);
+ m_scriptStateToId.removeAll(scriptStatesToRemove);
}
bool InjectedScriptManager::canAccessInspectedWorkerGlobalScope(NewScriptState*)
« no previous file with comments | « Source/core/fetch/ResourceLoadPriorityOptimizer.cpp ('k') | Source/core/inspector/PageRuntimeAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698