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

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

Issue 380093002: Update installed ServiceWorkers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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_controllee_request_handler.cc
diff --git a/content/browser/service_worker/service_worker_controllee_request_handler.cc b/content/browser/service_worker/service_worker_controllee_request_handler.cc
index 72682b3b43182b4b53d2f24daec50befde374450..42cb40ce2af704468b5c48977e23d34079810e08 100644
--- a/content/browser/service_worker/service_worker_controllee_request_handler.cc
+++ b/content/browser/service_worker/service_worker_controllee_request_handler.cc
@@ -120,18 +120,21 @@ ServiceWorkerControlleeRequestHandler::DidLookupRegistrationForMainResource(
if (status != SERVICE_WORKER_OK || !registration->active_version()) {
// No registration, or no active version for the registration is available.
job_->FallbackToNetwork();
+ // TODO(michaeln): If there's a waiting version, activate it instead of
+ // using the network.
return;
}
ServiceWorkerMetrics::CountControlledPageLoad();
- // TODO(michaeln): should SetWaitingVersion() even if no active version so
- // so the versions in the pipeline (.installing, .waiting) show up in the
- // attribute values.
+ // TODO(michaeln): if 'activating' wait until it's activated before
+ // forwarding the request to the serviceworker.
DCHECK(registration);
provider_host_->SetControllerVersion(registration->active_version());
provider_host_->SetActiveVersion(registration->active_version());
provider_host_->SetWaitingVersion(registration->waiting_version());
+ provider_host_->SetInstallingVersion(registration->installing_version());
+
job_->ForwardToServiceWorker();
}

Powered by Google App Engine
This is Rietveld 408576698