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

Unified Diff: third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp

Issue 1897143002: [CompositorWorker] Do not create WorkerBackingThread in shutdown sequence (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
« no previous file with comments | « third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp
index 644de114529b0c5986534ad14b14642bc4dd48c1..78f1ed6beb27b0a324c26fab5deda377eb353b22 100644
--- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp
+++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp
@@ -18,6 +18,12 @@ namespace blink {
namespace {
+// This is a singleton class holding the compositor worker thread in this
+// renderrer process. BackingThreadHolst::m_thread will never be cleared,
+// but Oilpan and V8 are detached from the thread when the last compositor
+// worker thread is gone.
+// See WorkerThread::terminateAndWaitForAllWorkers for the process shutdown
+// case.
class BackingThreadHolder {
public:
static BackingThreadHolder& instance()
@@ -27,10 +33,10 @@ public:
}
WorkerBackingThread* thread() { return m_thread.get(); }
- void clear() { m_thread = nullptr; }
void resetForTest()
{
ASSERT(!m_thread || (m_thread->workerScriptCount() == 0));
+ m_thread = nullptr;
m_thread = WorkerBackingThread::createForTest(Platform::current()->compositorThread());
}
@@ -71,11 +77,6 @@ WorkerGlobalScope*CompositorWorkerThread::createWorkerGlobalScope(PassOwnPtr<Wor
return CompositorWorkerGlobalScope::create(this, std::move(startupData), m_timeOrigin);
}
-void CompositorWorkerThread::clearSharedBackingThread()
-{
- BackingThreadHolder::instance().clear();
-}
-
void CompositorWorkerThread::resetSharedBackingThreadForTest()
{
BackingThreadHolder::instance().resetForTest();
« no previous file with comments | « third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698