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

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

Issue 1100413004: workers: Move ownership of WebThread from WorkerThread (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 5 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: Source/core/workers/WorkerThread.cpp
diff --git a/Source/core/workers/WorkerThread.cpp b/Source/core/workers/WorkerThread.cpp
index f59a49182a66ff3dcd4b57653f081d209767d181..8679bc071b18915b966013409b89b160f95d1d22 100644
--- a/Source/core/workers/WorkerThread.cpp
+++ b/Source/core/workers/WorkerThread.cpp
@@ -265,6 +265,7 @@ WorkerThread::WorkerThread(const char* threadName, PassRefPtr<WorkerLoaderProxy>
, m_isolate(nullptr)
, m_shutdownEvent(adoptPtr(blink::Platform::current()->createWaitableEvent()))
, m_terminationEvent(adoptPtr(blink::Platform::current()->createWaitableEvent()))
+ , m_thread(nullptr)
{
MutexLocker lock(threadSetMutex());
workerThreads().add(this);
@@ -281,8 +282,11 @@ void WorkerThread::start()
{
if (m_thread)
return;
-
- m_thread = createWebThreadSupportingGC();
+ m_thread = m_startupData->m_thread;
+ if (!m_thread) {
+ m_ownThread = createWebThreadSupportingGC();
+ m_thread = m_ownThread.get();
+ }
m_thread->postTask(FROM_HERE, new Task(threadSafeBind(&WorkerThread::initialize, AllowCrossThreadAccess(this))));
}

Powered by Google App Engine
This is Rietveld 408576698