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 317107ab6095c9e333cc1859fd235933167e5663..9629877d38362a0b01cc75c1354bb5905b602b0b 100644 |
--- a/content/browser/service_worker/service_worker_dispatcher_host.cc |
+++ b/content/browser/service_worker/service_worker_dispatcher_host.cc |
@@ -594,10 +594,12 @@ void ServiceWorkerDispatcherHost::OnSetHostedVersionId( |
if (!provider_host->SetHostedVersionId(version_id)) |
BadMessageReceived(); |
- // Retrieve the registration associated with |version_id|. |
ServiceWorkerVersion* version = GetContext()->GetLiveVersion(version_id); |
if (!version) |
return; |
+ |
+ // Retrieve the registration associated with |version|. The registration |
+ // must be alive because the version keeps it during starting worker. |
ServiceWorkerRegistration* registration = |
GetContext()->GetLiveRegistration(version->registration_id()); |
DCHECK(registration); |