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

Unified Diff: Source/core/dom/ScriptRunner.cpp

Issue 660233002: Oilpan: move ScriptLoader to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: No detachment of ScriptLoaders when finalizing ScriptRunner 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
« no previous file with comments | « Source/core/dom/ScriptRunner.h ('k') | Source/core/html/HTMLScriptElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ScriptRunner.cpp
diff --git a/Source/core/dom/ScriptRunner.cpp b/Source/core/dom/ScriptRunner.cpp
index 272570454c494a5e432eaade0c200aff5f23707a..44543abd54da0b4edd9e54bbfd7b30a2b3f8d947 100644
--- a/Source/core/dom/ScriptRunner.cpp
+++ b/Source/core/dom/ScriptRunner.cpp
@@ -42,13 +42,15 @@ ScriptRunner::ScriptRunner(Document* document)
ScriptRunner::~ScriptRunner()
{
+#if !ENABLE(OILPAN)
// Make sure that ScriptLoaders don't keep their PendingScripts alive.
- for (size_t i = 0; i < m_scriptsToExecuteInOrder.size(); ++i)
- m_scriptsToExecuteInOrder[i]->detach();
- for (size_t i = 0; i < m_scriptsToExecuteSoon.size(); ++i)
- m_scriptsToExecuteSoon[i]->detach();
- for (HashSet<ScriptLoader*>::iterator it = m_pendingAsyncScripts.begin(); it != m_pendingAsyncScripts.end(); ++it)
- (*it)->detach();
+ for (ScriptLoader* scriptLoader : m_scriptsToExecuteInOrder)
+ scriptLoader->detach();
+ for (ScriptLoader* scriptLoader : m_scriptsToExecuteSoon)
+ scriptLoader->detach();
+ for (ScriptLoader* scriptLoader : m_pendingAsyncScripts)
+ scriptLoader->detach();
+#endif
}
void ScriptRunner::addPendingAsyncScript(ScriptLoader* scriptLoader)
@@ -131,7 +133,7 @@ void ScriptRunner::timerFired(Timer<ScriptRunner>* timer)
RefPtrWillBeRawPtr<Document> protect(m_document.get());
- Vector<ScriptLoader*> scriptLoaders;
+ WillBeHeapVector<RawPtrWillBeMember<ScriptLoader> > scriptLoaders;
scriptLoaders.swap(m_scriptsToExecuteSoon);
size_t numInOrderScriptsToExecute = 0;
« no previous file with comments | « Source/core/dom/ScriptRunner.h ('k') | Source/core/html/HTMLScriptElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698