Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Unified Diff: content/browser/service_worker/service_worker_register_job.cc

Issue 894973003: ServiceWorker: Make "ready" fetches registration from browser process(2/3). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: #13 Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
}

Powered by Google App Engine
This is Rietveld 408576698