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

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

Issue 298863010: Oilpan: have PendingScripts trace their script elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Trace HTMLScriptRunnerHost from HTMLScriptRunner Created 6 years, 7 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/HTMLImageLoader.cpp » ('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 d33ea6ee52dedd7a55b82d1fd94e0ef3c94c0a5a..21798469eedb029b4f465b6350c647f54678508e 100644
--- a/Source/core/dom/ScriptRunner.cpp
+++ b/Source/core/dom/ScriptRunner.cpp
@@ -31,6 +31,7 @@
#include "core/dom/PendingScript.h"
#include "core/dom/ScriptLoader.h"
#include "core/fetch/ScriptResource.h"
+#include "platform/heap/Handle.h"
namespace WebCore {
@@ -43,12 +44,6 @@ ScriptRunner::ScriptRunner(Document* document)
ScriptRunner::~ScriptRunner()
{
- for (size_t i = 0; i < m_scriptsToExecuteSoon.size(); ++i)
- m_document->decrementLoadEventDelayCount();
- for (size_t i = 0; i < m_scriptsToExecuteInOrder.size(); ++i)
- m_document->decrementLoadEventDelayCount();
- for (size_t i = 0; i < m_pendingAsyncScripts.size(); ++i)
- m_document->decrementLoadEventDelayCount();
}
void ScriptRunner::queueScriptForExecution(ScriptLoader* scriptLoader, ResourcePtr<ScriptResource> resource, ExecutionType executionType)
@@ -118,7 +113,7 @@ void ScriptRunner::timerFired(Timer<ScriptRunner>* timer)
{
ASSERT_UNUSED(timer, timer == &m_timer);
- RefPtr<Document> protect(m_document);
+ RefPtrWillBeRawPtr<Document> protect(m_document.get());
Vector<PendingScript> scripts;
scripts.swap(m_scriptsToExecuteSoon);
@@ -132,10 +127,18 @@ void ScriptRunner::timerFired(Timer<ScriptRunner>* timer)
size_t size = scripts.size();
for (size_t i = 0; i < size; ++i) {
ScriptResource* resource = scripts[i].resource();
- RefPtr<Element> element = scripts[i].releaseElementAndClear();
+ RefPtrWillBeRawPtr<Element> element = scripts[i].releaseElementAndClear();
toScriptLoaderIfPossible(element.get())->execute(resource);
m_document->decrementLoadEventDelayCount();
}
}
+void ScriptRunner::trace(Visitor* visitor)
+{
+ visitor->trace(m_document);
+ visitor->trace(m_scriptsToExecuteInOrder);
+ visitor->trace(m_scriptsToExecuteSoon);
+ visitor->trace(m_pendingAsyncScripts);
+}
+
}
« no previous file with comments | « Source/core/dom/ScriptRunner.h ('k') | Source/core/html/HTMLImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698