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 d1ae0609bdd60ac2615626ea69c73c2a60a7ca32..7e6edcc962b712ae0dcc1228e8d0ecb669f358d2 100644 |
--- a/content/browser/service_worker/service_worker_dispatcher_host.cc |
+++ b/content/browser/service_worker/service_worker_dispatcher_host.cc |
@@ -552,6 +552,22 @@ void ServiceWorkerDispatcherHost::OnSetHostedVersionId( |
return; |
if (!provider_host->SetHostedVersionId(version_id)) |
BadMessageReceived(); |
+ |
+ // Retrieve the registration associated with |version_id|. |
+ ServiceWorkerVersion* version = GetContext()->GetLiveVersion(version_id); |
+ if (!version) |
+ return; |
+ ServiceWorkerRegistration* registration = |
+ GetContext()->GetLiveRegistration(version->registration_id()); |
+ DCHECK(registration); |
+ |
+ ServiceWorkerRegistrationObjectInfo info; |
+ ServiceWorkerVersionAttributes attrs; |
+ GetRegistrationObjectInfoAndVersionAttributes( |
+ provider_id, registration, &info, &attrs); |
+ |
+ Send(new ServiceWorkerMsg_AssociateRegistrationWithServiceWorker( |
+ kDocumentMainThreadId, provider_id, info, attrs)); |
} |
ServiceWorkerRegistrationHandle* |