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

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

Issue 1380543002: On Document disposal, only dispose of script runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert static method Created 5 years, 3 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 | « third_party/WebKit/Source/core/dom/ScriptRunner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ScriptRunner.cpp
diff --git a/third_party/WebKit/Source/core/dom/ScriptRunner.cpp b/third_party/WebKit/Source/core/dom/ScriptRunner.cpp
index 748809724c54905f9089c9175b69ee405c8486d2..c4ef3e7f6636ec7e8751c52c151262bb7e95d5ff 100644
--- a/third_party/WebKit/Source/core/dom/ScriptRunner.cpp
+++ b/third_party/WebKit/Source/core/dom/ScriptRunner.cpp
@@ -48,6 +48,13 @@ ScriptRunner::ScriptRunner(Document* document)
ScriptRunner::~ScriptRunner()
{
#if !ENABLE(OILPAN)
+ dispose();
+#endif
+}
+
+#if !ENABLE(OILPAN)
+void ScriptRunner::dispose()
+{
// Make sure that ScriptLoaders don't keep their PendingScripts alive.
for (ScriptLoader* scriptLoader : m_scriptsToExecuteInOrder)
scriptLoader->detach();
@@ -55,8 +62,12 @@ ScriptRunner::~ScriptRunner()
scriptLoader->detach();
for (ScriptLoader* scriptLoader : m_pendingAsyncScripts)
scriptLoader->detach();
-#endif
+
+ m_scriptsToExecuteInOrder.clear();
+ m_scriptsToExecuteSoon.clear();
+ m_pendingAsyncScripts.clear();
}
+#endif
void ScriptRunner::addPendingAsyncScript(ScriptLoader* scriptLoader)
{
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptRunner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698