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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp

Issue 2268933002: ServiceWorker: Detect forcible worker thread termination in a correct way (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert moving getExitCode() in favor of https://codereview.chromium.org/2274453002/ Created 4 years, 4 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.cpp ('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/serviceworkers/ServiceWorkerGlobalScope.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
index ddb90f1ce27bad4efbf4a1e360210dc73f42fad2..144f0b649f54ede118ad8d47fb2d97f6b80cdeed 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
@@ -186,8 +186,12 @@ void ServiceWorkerGlobalScope::dispatchExtendableEvent(Event* event, WaitUntilOb
observer->willDispatchEvent();
dispatchEvent(event);
- if (thread()->terminated())
+
+ // Check if the worker thread is forcibly terminated during the event
+ // because of timeout etc.
+ if (thread()->isForciblyTerminated())
m_hadErrorInTopLevelEventHandler = true;
+
observer->didDispatchEvent(m_hadErrorInTopLevelEventHandler);
}
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerThread.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698