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

Unified Diff: content/child/service_worker/web_service_worker_provider_impl.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: rebase Created 5 years, 9 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/child/service_worker/web_service_worker_provider_impl.cc
diff --git a/content/child/service_worker/web_service_worker_provider_impl.cc b/content/child/service_worker/web_service_worker_provider_impl.cc
index 5b7d7406cd2fa34cc69a74a330c9eafc6171027b..f3a57f02efc99af2d046a30d88024ede26baeb57 100644
--- a/content/child/service_worker/web_service_worker_provider_impl.cc
+++ b/content/child/service_worker/web_service_worker_provider_impl.cc
@@ -54,24 +54,6 @@ void WebServiceWorkerProviderImpl::setClient(
// This provider is not associated with any registration.
return;
}
-
- // Set .ready if the associated registration has the active service worker.
- if (context_->active_handle_id() != kInvalidServiceWorkerHandleId) {
- WebServiceWorkerRegistrationImpl* registration =
- GetDispatcher()->FindServiceWorkerRegistration(info, false);
- if (!registration) {
- registration =
- GetDispatcher()->CreateServiceWorkerRegistration(info, false);
- registration->SetInstalling(
- GetDispatcher()->GetServiceWorker(attrs.installing, false));
- registration->SetWaiting(
- GetDispatcher()->GetServiceWorker(attrs.waiting, false));
- registration->SetActive(
- GetDispatcher()->GetServiceWorker(attrs.active, false));
- }
- client->setReadyRegistration(registration);
- }
-
if (context_->controller_handle_id() != kInvalidServiceWorkerHandleId) {
client->setController(GetDispatcher()->GetServiceWorker(
context_->controller()->info(), false),
@@ -100,6 +82,11 @@ void WebServiceWorkerProviderImpl::getRegistration(
GetDispatcher()->GetRegistration(provider_id_, document_url, callbacks);
}
+void WebServiceWorkerProviderImpl::getRegistrationForReady(
+ WebServiceWorkerGetRegistrationForReadyCallbacks* callbacks) {
+ GetDispatcher()->GetRegistrationForReady(provider_id_, callbacks);
+}
+
void WebServiceWorkerProviderImpl::RemoveProviderClient() {
// Remove the provider client, but only if the dispatcher is still there.
// (For cleanup path we don't need to bother creating a new dispatcher)

Powered by Google App Engine
This is Rietveld 408576698