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

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

Issue 2150863002: service worker: Don't BadMessageReceived when a response for a timed out request arrives (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment and move expect Created 4 years, 5 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 | content/browser/service_worker/service_worker_dispatcher_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/embedded_worker_registry.cc
diff --git a/content/browser/service_worker/embedded_worker_registry.cc b/content/browser/service_worker/embedded_worker_registry.cc
index 70f2d9ef048aa3b77f0ff43230a92f80242c59df..f0031c5ec9b0493c4c612d38daf488a92ad9f401 100644
--- a/content/browser/service_worker/embedded_worker_registry.cc
+++ b/content/browser/service_worker/embedded_worker_registry.cc
@@ -61,7 +61,14 @@ bool EmbeddedWorkerRegistry::OnMessageReceived(const IPC::Message& message,
// purposely handling the message as no-op.
return true;
}
- return worker->OnMessageReceived(message);
+ bool handled = worker->OnMessageReceived(message);
+
+ // Assume an unhandled message for a stopping worker is because the message
+ // was timed out and its handler removed prior to stopping.
+ // We might be more precise and record timed out request ids, but some
+ // cumbersome bookkeeping is needed and the IPC messaging will soon migrate
+ // to Mojo anyway.
+ return handled || worker->status() == EmbeddedWorkerStatus::STOPPING;
}
void EmbeddedWorkerRegistry::Shutdown() {
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_dispatcher_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698