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

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

Issue 2324763002: Worker: Remove WorkerThread::terminated() (Closed)
Patch Set: Created 4 years, 3 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/core/workers/WorkerThread.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/core/workers/WorkerThread.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.cpp b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
index f91807ed230e21a4e46fd0ffa8c231cc2524234a..d476d69a6b275249b76d5b896a0dea0cd7be7e79 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
@@ -318,12 +318,6 @@ WorkerInspectorController* WorkerThread::workerInspectorController()
return m_workerInspectorController.get();
}
-bool WorkerThread::terminated()
-{
- MutexLocker lock(m_threadStateMutex);
- return m_requestedToTerminate;
-}
-
unsigned WorkerThread::workerThreadCount()
{
MutexLocker lock(threadSetMutex());
@@ -625,22 +619,14 @@ void WorkerThread::performShutdownOnWorkerThread()
void WorkerThread::performTaskOnWorkerThread(std::unique_ptr<ExecutionContextTask> task, bool isInstrumented)
{
DCHECK(isCurrentThread());
- if (isInShutdown())
- return;
-
- WorkerOrWorkletGlobalScope* global = globalScope();
- // If the thread is terminated before it had a chance initialize (see
- // WorkerThread::Initialize()), we mustn't run any of the posted tasks.
- if (!global) {
- DCHECK(terminated());
+ if (m_threadState != ThreadState::Running)
return;
- }
- InspectorInstrumentation::AsyncTask asyncTask(global, task.get(), isInstrumented);
+ InspectorInstrumentation::AsyncTask asyncTask(globalScope(), task.get(), isInstrumented);
{
DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scopedUsCounter, new CustomCountHistogram("WorkerThread.Task.Time", 0, 10000000, 50));
ScopedUsHistogramTimer timer(scopedUsCounter);
- task->performTask(global);
+ task->performTask(globalScope());
}
}
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerThread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698