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 0a28dc1ccab0af6b23f99e53b9b04f4f851599e6..c9639d98e952a46f9c5b6b61f2c941b29265bc4f 100644 |
--- a/content/browser/service_worker/service_worker_register_job.cc |
+++ b/content/browser/service_worker/service_worker_register_job.cc |
@@ -260,7 +260,7 @@ void ServiceWorkerRegisterJob::RegisterAndContinue() { |
set_registration(new ServiceWorkerRegistration( |
pattern_, context_->storage()->NewRegistrationId(), context_)); |
- AssociateProviderHostsToRegistration(registration()); |
+ NotifyProviderHostsForRegistration(registration()); |
falken
2015/03/02 02:09:41
nit: By the name only, I'd wonder what this functi
xiang
2015/03/03 08:56:04
Agree, that's better.
|
UpdateAndContinue(); |
} |
@@ -547,18 +547,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); |
} |
} |