| Index: content/browser/service_worker/service_worker_register_job.cc
|
| diff --git a/content/browser/service_worker/service_worker_register_job.cc b/content/browser/service_worker/service_worker_register_job.cc
|
| index 635496830bf58154c9d7685c79a394efe665dd97..e4fc2fd9f08cef86bd9055845def4226c2470e4c 100644
|
| --- a/content/browser/service_worker/service_worker_register_job.cc
|
| +++ b/content/browser/service_worker/service_worker_register_job.cc
|
| @@ -281,7 +281,7 @@ void ServiceWorkerRegisterJob::RegisterAndContinue(
|
|
|
| set_registration(new ServiceWorkerRegistration(
|
| pattern_, context_->storage()->NewRegistrationId(), context_));
|
| - AssociateProviderHostsToRegistration(registration());
|
| + NotifyProviderHostsForRegistration(registration());
|
| UpdateAndContinue();
|
| }
|
|
|
| @@ -570,18 +570,17 @@ void ServiceWorkerRegisterJob::OnCompareScriptResourcesComplete(
|
| new_version()->embedded_worker()->RemoveListener(this);
|
| }
|
|
|
| -void ServiceWorkerRegisterJob::AssociateProviderHostsToRegistration(
|
| +void ServiceWorkerRegisterJob::NotifyProviderHostsForRegistration(
|
| 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->CanAssociateRegistration(registration))
|
| - host->AssociateRegistration(registration);
|
| - }
|
| + if (!ServiceWorkerUtils::ScopeMatches(registration->pattern(),
|
| + host->document_url()))
|
| + continue;
|
| + host->AddPotentialRegistration(registration);
|
| }
|
| }
|
|
|
|
|