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

Unified Diff: content/browser/service_worker/embedded_worker_instance.cc

Issue 2467223002: ServiceWorker: Add a check if error handler runs on the right thread (Closed)
Patch Set: Created 4 years, 1 month 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: content/browser/service_worker/embedded_worker_instance.cc
diff --git a/content/browser/service_worker/embedded_worker_instance.cc b/content/browser/service_worker/embedded_worker_instance.cc
index dcf7580597bc687029169a2ba30cc41139c05a63..8a980ef3db305d61eb9b2a993058782769b0a026 100644
--- a/content/browser/service_worker/embedded_worker_instance.cc
+++ b/content/browser/service_worker/embedded_worker_instance.cc
@@ -813,6 +813,11 @@ void EmbeddedWorkerInstance::OnDetached() {
}
void EmbeddedWorkerInstance::Detach() {
+ // This could be called on the UI thread if |client_| still be valid when the
+ // message loop on the UI thread gets destructed.
nhiroki 2016/11/02 07:59:50 Making an indirection could be saner than directly
horo 2016/11/02 08:22:54 +1
+ // TODO(shimazu): Remove this after https://crbug.com/604762 is fixed
+ if (!BrowserThread::CurrentlyOn(BrowserThread::IO))
+ return;
horo 2016/11/02 07:49:12 Please add DCHECK for mojo sw. if (!BrowserThread
registry_->DetachWorker(process_id(), embedded_worker_id());
OnDetached();
}
« 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