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

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

Issue 798833002: ServiceWorker: Make skipWaiting only works on documents using current registration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo fix Created 6 years 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_registration.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_provider_host.cc
diff --git a/content/browser/service_worker/service_worker_provider_host.cc b/content/browser/service_worker/service_worker_provider_host.cc
index 2bb6499487916db409c6eecbd9c10cae0863b7e2..51dff4550481d24fbb9103dff0187210481b3492 100644
--- a/content/browser/service_worker/service_worker_provider_host.cc
+++ b/content/browser/service_worker/service_worker_provider_host.cc
@@ -84,6 +84,11 @@ void ServiceWorkerProviderHost::OnRegistrationFailed(
void ServiceWorkerProviderHost::OnSkippedWaiting(
ServiceWorkerRegistration* registration) {
DCHECK_EQ(associated_registration_.get(), registration);
+ // A client is "using" a registration if it is controlled by the active
+ // worker of the registration. skipWaiting doesn't cause a client to start
+ // using the registration.
+ if (!controlling_version_)
+ return;
ServiceWorkerVersion* active_version = registration->active_version();
DCHECK_EQ(active_version->status(), ServiceWorkerVersion::ACTIVATING);
SetControllerVersionAttribute(active_version);
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_registration.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698