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

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

Issue 2154663002: service worker: Relax the BadMessageReceived call in OnSetHostedVersionId (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: patch 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
Index: content/browser/service_worker/service_worker_dispatcher_host.cc
diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc
index c557be4c0497c838b5a7f0fe62d885cdc3c7c0be..b8a29426de808c436b0b8d1ad1d20889d738417d 100644
--- a/content/browser/service_worker/service_worker_dispatcher_host.cc
+++ b/content/browser/service_worker/service_worker_dispatcher_host.cc
@@ -852,7 +852,8 @@ void ServiceWorkerDispatcherHost::OnProviderDestroyed(int provider_id) {
}
void ServiceWorkerDispatcherHost::OnSetHostedVersionId(int provider_id,
- int64_t version_id) {
+ int64_t version_id,
+ int embedded_worker_id) {
TRACE_EVENT0("ServiceWorker",
"ServiceWorkerDispatcherHost::OnSetHostedVersionId");
if (!GetContext())
@@ -882,6 +883,10 @@ void ServiceWorkerDispatcherHost::OnSetHostedVersionId(int provider_id,
ServiceWorkerVersion* version = GetContext()->GetLiveVersion(version_id);
if (!version || version->running_status() != EmbeddedWorkerStatus::STARTING)
return;
+ // If the version has a different embedded worker, assume the message is about
dcheng 2016/07/15 09:25:46 Nit: newline above for consistency
falken 2016/07/15 11:30:35 Done.
+ // a detached worker and ignore.
+ if (version->embedded_worker()->embedded_worker_id() != embedded_worker_id)
+ return;
// A process for the worker must be equal to a process for the provider host.
if (version->embedded_worker()->process_id() != provider_host->process_id()) {

Powered by Google App Engine
This is Rietveld 408576698