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

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

Issue 2053273002: Remove WorkerBackingThread::scriptCount (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
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());

Powered by Google App Engine
This is Rietveld 408576698