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

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

Issue 2849583004: Worker: Stop disposing of the global scope scheduler in WorkerThread::WillProcessTask() (Closed)
Patch Set: Created 3 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 | « no previous file | 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 8966c10d921b29417784fb9969cec339b30ca480..561d7c477deb403346534c0ea2f319bd17e146e2 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
@@ -174,12 +174,6 @@ void WorkerThread::WillProcessTask() {
// No tasks should get executed after we have closed.
DCHECK(!GlobalScope()->IsClosing());
-
- if (IsForciblyTerminated()) {
- // The script has been terminated forcibly, which means we need to
- // ask objects in the thread to stop working as soon as possible.
- PrepareForShutdownOnWorkerThread();
- }
}
void WorkerThread::DidProcessTask() {
@@ -192,6 +186,10 @@ void WorkerThread::DidProcessTask() {
// Stop further worker tasks to run after this point.
PrepareForShutdownOnWorkerThread();
+ } else if (IsForciblyTerminated()) {
+ // The script has been terminated forcibly, which means we need to
+ // ask objects in the thread to stop working as soon as possible.
+ PrepareForShutdownOnWorkerThread();
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698