| 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 2458e8af75c6f2bf7796ad32a3655d418342a5f8..de797adf0bd59754688ba70c3dbda8872bb9bee5 100644
|
| --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp
|
| +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp
|
| @@ -15,6 +15,7 @@
|
| #include "platform/WaitableEvent.h"
|
| #include "platform/WebThreadSupportingGC.h"
|
| #include "public/platform/Platform.h"
|
| +#include "wtf/Assertions.h"
|
|
|
| namespace blink {
|
|
|
| @@ -39,20 +40,10 @@ public:
|
| s_instance = new BackingThreadHolder;
|
| }
|
|
|
| - static void terminateExecution()
|
| - {
|
| - MutexLocker locker(holderInstanceMutex());
|
| - if (s_instance && s_instance->m_initialized) {
|
| - s_instance->thread()->isolate()->TerminateExecution();
|
| - s_instance->m_terminatingExecution = true;
|
| - }
|
| - }
|
| -
|
| static void clear()
|
| {
|
| MutexLocker locker(holderInstanceMutex());
|
| if (s_instance) {
|
| - DCHECK(!s_instance->m_initialized || s_instance->m_terminatingExecution);
|
| s_instance->shutdownAndWait();
|
| delete s_instance;
|
| s_instance = nullptr;
|
| @@ -85,8 +76,8 @@ private:
|
| void initializeOnThread()
|
| {
|
| MutexLocker locker(holderInstanceMutex());
|
| - DCHECK_EQ(0u, m_thread->workerScriptCount()) << "BackingThreadHolder should be the first to attach to WorkerBackingThread";
|
| - m_thread->attach();
|
| + DCHECK(!m_initialized);
|
| + m_thread->initialize();
|
| m_initialized = true;
|
| }
|
|
|
| @@ -100,13 +91,11 @@ private:
|
|
|
| void shutdownOnThread(WaitableEvent* doneEvent)
|
| {
|
| - DCHECK_EQ(1u, m_thread->workerScriptCount()) << "BackingThreadHolder should be the last to detach from WorkerBackingThread";
|
| - m_thread->detach();
|
| + m_thread->shutdown();
|
| doneEvent->signal();
|
| }
|
|
|
| OwnPtr<WorkerBackingThread> m_thread;
|
| - bool m_terminatingExecution = false;
|
| bool m_initialized = false;
|
|
|
| static BackingThreadHolder* s_instance;
|
| @@ -151,12 +140,6 @@ void CompositorWorkerThread::ensureSharedBackingThread()
|
| BackingThreadHolder::ensureInstance();
|
| }
|
|
|
| -void CompositorWorkerThread::terminateExecution()
|
| -{
|
| - DCHECK(isMainThread());
|
| - BackingThreadHolder::terminateExecution();
|
| -}
|
| -
|
| void CompositorWorkerThread::clearSharedBackingThread()
|
| {
|
| DCHECK(isMainThread());
|
|
|