Index: content/browser/service_worker/service_worker_provider_host.cc |
diff --git a/content/browser/service_worker/service_worker_provider_host.cc b/content/browser/service_worker/service_worker_provider_host.cc |
index bd0c5ea3197e310de114dc2618f42abc0db0618d..b0d91d157d5ba56694e785daf909e4f66ba27db9 100644 |
--- a/content/browser/service_worker/service_worker_provider_host.cc |
+++ b/content/browser/service_worker/service_worker_provider_host.cc |
@@ -145,6 +145,15 @@ void ServiceWorkerProviderHost::AssociateRegistration( |
ServiceWorkerRegistration* registration) { |
DCHECK(CanAssociateRegistration(registration)); |
associated_registration_ = registration; |
+ |
+ if (dispatcher_host_) { |
+ ServiceWorkerRegistrationObjectInfo info = |
+ dispatcher_host_->GetOrCreateRegistrationHandle( |
+ provider_id(), registration); |
+ dispatcher_host_->Send(new ServiceWorkerMsg_AssociateRegistration( |
+ kDocumentMainThreadId, provider_id(), info)); |
+ } |
+ |
registration->AddListener(this); |
UpdatePotentialControllees(registration->installing_version(), |
registration->waiting_version(), |
@@ -155,6 +164,12 @@ void ServiceWorkerProviderHost::AssociateRegistration( |
void ServiceWorkerProviderHost::UnassociateRegistration() { |
if (!associated_registration_.get()) |
return; |
+ |
+ if (dispatcher_host_) { |
+ dispatcher_host_->Send(new ServiceWorkerMsg_UnassociateRegistration( |
+ kDocumentMainThreadId, provider_id())); |
+ } |
+ |
associated_registration_->RemoveListener(this); |
associated_registration_ = NULL; |
UpdatePotentialControllees(NULL, NULL, NULL); |