| 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 917bdeadc8e148ae9b5fd8237f9e8a347fe0ccbb..92872e2ca9096cb6a36b2fcad6fb1c33696f0a31 100644
|
| --- a/content/browser/service_worker/service_worker_register_job.cc
|
| +++ b/content/browser/service_worker/service_worker_register_job.cc
|
| @@ -250,7 +250,7 @@ void ServiceWorkerRegisterJob::RegisterAndContinue() {
|
|
|
| set_registration(new ServiceWorkerRegistration(
|
| pattern_, context_->storage()->NewRegistrationId(), context_));
|
| - AssociateProviderHostsToRegistration(registration());
|
| + NotifyProviderHostsForRegistration(registration());
|
| UpdateAndContinue();
|
| }
|
|
|
| @@ -523,18 +523,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->AddMatchingRegistration(registration);
|
| }
|
| }
|
|
|
|
|