Index: content/browser/service_worker/service_worker_unregister_job.cc |
diff --git a/content/browser/service_worker/service_worker_unregister_job.cc b/content/browser/service_worker/service_worker_unregister_job.cc |
index 4b15f7df6e80cf31d94d01e6688e47e167f264ba..3806c91c91d85933298143f19b6810bea63b04ac 100644 |
--- a/content/browser/service_worker/service_worker_unregister_job.cc |
+++ b/content/browser/service_worker/service_worker_unregister_job.cc |
@@ -74,6 +74,7 @@ void ServiceWorkerUnregisterJob::OnRegistrationFound( |
registration->ClearWhenReady(); |
+ UnassociateProviderHostsFromRegistration(registration); |
Complete(SERVICE_WORKER_OK); |
} |
@@ -99,4 +100,19 @@ void ServiceWorkerUnregisterJob::ResolvePromise( |
} |
} |
+void ServiceWorkerUnregisterJob::UnassociateProviderHostsFromRegistration( |
+ ServiceWorkerRegistration* registration) { |
+ DCHECK(registration); |
+ for (scoped_ptr<ServiceWorkerContextCore::ProviderHostIterator> it = |
+ context_->GetProviderHostIterator(); |
+ !it->IsAtEnd(); it->Advance()) { |
+ ServiceWorkerProviderHost* host = it->GetProviderHost(); |
+ if (ServiceWorkerUtils::ScopeMatches(registration->pattern(), |
+ host->document_url())) { |
+ if (host->associated_registration()->id() == registration->id()) |
+ host->UnassociateRegistration(); |
michaeln
2014/09/04 00:27:23
This does not look right?
The unreg doesn't reall
nhiroki
2014/09/08 15:55:51
Ah, yes. This is not correct. Removed.
|
+ } |
+ } |
+} |
+ |
} // namespace content |