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

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

Issue 1887573002: Remove ENABLE(OILPAN) from ScriptRunner and PendingScript. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 1a3ed59a0d5817fa8153ed1bebf1073ffc6c112c..3b0eb121582fe98ddcefa8aec297522e58ffdb8f 100644
--- a/third_party/WebKit/Source/core/dom/ScriptRunner.cpp
+++ b/third_party/WebKit/Source/core/dom/ScriptRunner.cpp
@@ -41,10 +41,6 @@ ScriptRunner::ScriptRunner(Document* document)
, m_taskRunner(Platform::current()->currentThread()->scheduler()->loadingTaskRunner())
, m_numberOfInOrderScriptsWithPendingNotification(0)
, m_isSuspended(false)
-#if !ENABLE(OILPAN)
- , m_isDisposed(false)
- , m_weakPointerFactoryForTasks(this)
-#endif
{
DCHECK(document);
#ifndef NDEBUG
@@ -54,32 +50,7 @@ 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_pendingInOrderScripts)
- scriptLoader->detach();
- for (ScriptLoader* scriptLoader : m_pendingAsyncScripts)
- scriptLoader->detach();
- for (ScriptLoader* scriptLoader : m_inOrderScriptsToExecuteSoon)
- scriptLoader->detach();
- for (ScriptLoader* scriptLoader : m_asyncScriptsToExecuteSoon)
- scriptLoader->detach();
-
- m_pendingInOrderScripts.clear();
- m_pendingAsyncScripts.clear();
- m_inOrderScriptsToExecuteSoon.clear();
- m_asyncScriptsToExecuteSoon.clear();
- m_isDisposed = true;
- m_numberOfInOrderScriptsWithPendingNotification = 0;
}
-#endif
void ScriptRunner::queueScriptForExecution(ScriptLoader* scriptLoader, ExecutionType executionType)
{
@@ -99,11 +70,7 @@ void ScriptRunner::queueScriptForExecution(ScriptLoader* scriptLoader, Execution
void ScriptRunner::postTask(const WebTraceLocation& webTraceLocation)
{
-#if !ENABLE(OILPAN)
- m_taskRunner->postTask(webTraceLocation, bind(&ScriptRunner::executeTask, m_weakPointerFactoryForTasks.createWeakPtr()));
-#else
m_taskRunner->postTask(webTraceLocation, bind(&ScriptRunner::executeTask, WeakPersistentThisPointer<ScriptRunner>(this)));
-#endif
}
void ScriptRunner::suspend()
@@ -190,21 +157,12 @@ void ScriptRunner::notifyScriptLoadError(ScriptLoader* scriptLoader, ExecutionTy
// where the ScriptLoader is associated with the wrong ScriptRunner
// (otherwise we'd cause a use-after-free in ~ScriptRunner when it tries
// to detach).
- bool foundLoader = m_pendingAsyncScripts.contains(scriptLoader);
-#if !ENABLE(OILPAN)
- // If the ScriptRunner has been disposed of, no pending scripts remain.
- foundLoader = foundLoader || m_isDisposed;
-#endif
- SECURITY_CHECK(foundLoader);
+ SECURITY_CHECK(m_pendingAsyncScripts.contains(scriptLoader));
m_pendingAsyncScripts.remove(scriptLoader);
break;
}
case IN_ORDER_EXECUTION:
- bool foundLoader = removePendingInOrderScript(scriptLoader);
-#if !ENABLE(OILPAN)
- foundLoader = foundLoader || m_isDisposed;
-#endif
- SECURITY_CHECK(foundLoader);
+ SECURITY_CHECK(removePendingInOrderScript(scriptLoader));
scheduleReadyInOrderScripts();
break;
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptRunner.h ('k') | third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698