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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp

Issue 1895873006: compositor-worker: Initialize CW machinery plumbing to compositor and fire CW rAF callbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bring up oilpan support during compositor worker creation and oilpan the compositor mutator and pro… 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/workers/WorkerBackingThread.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp b/third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp
index 18fb34ddf42f5fa6ecaf43c43aacd64868c830c8..5c931cd97cebb9b5720253d491e0ad6e67d08e54 100644
--- a/third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp
@@ -29,6 +29,7 @@ WorkerBackingThread::WorkerBackingThread(WebThread* thread, bool shouldCallGCOnS
, m_isOwningThread(false)
, m_shouldCallGCOnShutdown(shouldCallGCOnShutdown)
{
+ thread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&WorkerBackingThread::initialize, AllowCrossThreadAccess(this)));
}
WorkerBackingThread::~WorkerBackingThread()
@@ -46,7 +47,8 @@ void WorkerBackingThread::attach()
if (++m_workerScriptCount > 1)
return;
}
- initialize();
+ if (m_isOwningThread)
+ initialize();
}
void WorkerBackingThread::detach()
@@ -56,7 +58,8 @@ void WorkerBackingThread::detach()
if (--m_workerScriptCount > 0)
return;
}
- shutdown();
+ if (m_isOwningThread)
+ shutdown();
}
void WorkerBackingThread::initialize()

Powered by Google App Engine
This is Rietveld 408576698