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

Unified Diff: Source/core/workers/WorkerThread.cpp

Issue 1168073002: Revert "compositor-worker: Share a thread and an isolate for compositor workers." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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/workers/WorkerThread.h ('k') | Source/modules/InitModules.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerThread.cpp
diff --git a/Source/core/workers/WorkerThread.cpp b/Source/core/workers/WorkerThread.cpp
index 66aa8985fbd0ddee6fc754aaa5b50a8d500efc46..d3b4156f03aa9f4e4999b71dfed1ec6575cbcd0a 100644
--- a/Source/core/workers/WorkerThread.cpp
+++ b/Source/core/workers/WorkerThread.cpp
@@ -218,8 +218,8 @@ void WorkerThread::initialize(PassOwnPtr<WorkerThreadStartupData> startupData)
}
m_microtaskRunner = adoptPtr(new WorkerMicrotaskRunner(this));
- initializeBackingThread();
backingThread().addTaskObserver(m_microtaskRunner.get());
+ backingThread().initialize();
m_isolate = initializeIsolate();
m_workerGlobalScope = createWorkerGlobalScope(startupData);
@@ -274,9 +274,8 @@ void WorkerThread::shutdown()
m_workerGlobalScope = nullptr;
backingThread().removeTaskObserver(m_microtaskRunner.get());
- shutdownBackingThread();
+ backingThread().shutdown();
destroyIsolate();
- m_isolate = nullptr;
m_microtaskRunner = nullptr;
@@ -337,7 +336,6 @@ void WorkerThread::stopInternal()
}
// Ensure that tasks are being handled by thread event loop. If script execution weren't forbidden, a while(1) loop in JS could keep the thread alive forever.
- m_workerGlobalScope->script()->willScheduleExecutionTermination();
terminateV8Execution();
InspectorInstrumentation::didKillAllExecutionContextTasks(m_workerGlobalScope.get());
@@ -407,18 +405,6 @@ void WorkerThread::postDelayedTask(const WebTraceLocation& location, PassOwnPtr<
backingThread().postDelayedTask(location, WorkerThreadTask::create(*this, task, true).leakPtr(), delayMs);
}
-void WorkerThread::initializeBackingThread()
-{
- ASSERT(isCurrentThread());
- backingThread().initialize();
-}
-
-void WorkerThread::shutdownBackingThread()
-{
- ASSERT(isCurrentThread());
- backingThread().shutdown();
-}
-
v8::Isolate* WorkerThread::initializeIsolate()
{
ASSERT(isCurrentThread());
@@ -445,11 +431,13 @@ void WorkerThread::destroyIsolate()
{
ASSERT(isCurrentThread());
V8PerIsolateData::destroy(m_isolate);
+ m_isolate = nullptr;
}
void WorkerThread::terminateV8Execution()
{
ASSERT(isMainThread());
+ m_workerGlobalScope->script()->willScheduleExecutionTermination();
v8::V8::TerminateExecution(m_isolate);
}
« no previous file with comments | « Source/core/workers/WorkerThread.h ('k') | Source/modules/InitModules.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698