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

Side by Side 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: edit comments 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_registration.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/service_worker/service_worker_provider_host.h" 5 #include "content/browser/service_worker/service_worker_provider_host.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "content/browser/message_port_message_filter.h" 8 #include "content/browser/message_port_message_filter.h"
9 #include "content/browser/service_worker/service_worker_context_core.h" 9 #include "content/browser/service_worker/service_worker_context_core.h"
10 #include "content/browser/service_worker/service_worker_context_request_handler. h" 10 #include "content/browser/service_worker/service_worker_context_request_handler. h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 void ServiceWorkerProviderHost::OnRegistrationFailed( 78 void ServiceWorkerProviderHost::OnRegistrationFailed(
79 ServiceWorkerRegistration* registration) { 79 ServiceWorkerRegistration* registration) {
80 DCHECK_EQ(associated_registration_.get(), registration); 80 DCHECK_EQ(associated_registration_.get(), registration);
81 DisassociateRegistration(); 81 DisassociateRegistration();
82 } 82 }
83 83
84 void ServiceWorkerProviderHost::OnSkippedWaiting( 84 void ServiceWorkerProviderHost::OnSkippedWaiting(
85 ServiceWorkerRegistration* registration) { 85 ServiceWorkerRegistration* registration) {
86 DCHECK_EQ(associated_registration_.get(), registration); 86 DCHECK_EQ(associated_registration_.get(), registration);
87 // A client is using a registration if it is controlled by the active worker
88 // of the registration. skipWaiting doesn't cause a client to start using
89 // the registration.
falken 2014/12/15 06:18:01 Since "using" is a normal English word, it would m
90 if (!controlling_version_)
91 return;
87 ServiceWorkerVersion* active_version = registration->active_version(); 92 ServiceWorkerVersion* active_version = registration->active_version();
88 DCHECK_EQ(active_version->status(), ServiceWorkerVersion::ACTIVATING); 93 DCHECK_EQ(active_version->status(), ServiceWorkerVersion::ACTIVATING);
89 SetControllerVersionAttribute(active_version); 94 SetControllerVersionAttribute(active_version);
90 } 95 }
91 96
92 void ServiceWorkerProviderHost::SetDocumentUrl(const GURL& url) { 97 void ServiceWorkerProviderHost::SetDocumentUrl(const GURL& url) {
93 DCHECK(!url.has_ref()); 98 DCHECK(!url.has_ref());
94 document_url_ = url; 99 document_url_ = url;
95 } 100 }
96 101
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 context_->process_manager()->RemoveProcessReferenceFromPattern( 350 context_->process_manager()->RemoveProcessReferenceFromPattern(
346 pattern, render_process_id_); 351 pattern, render_process_id_);
347 } 352 }
348 } 353 }
349 354
350 bool ServiceWorkerProviderHost::IsContextAlive() { 355 bool ServiceWorkerProviderHost::IsContextAlive() {
351 return context_ != NULL; 356 return context_ != NULL;
352 } 357 }
353 358
354 } // namespace content 359 } // namespace content
OLDNEW
« 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