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

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: 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
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 if (!controlling_version_)
falken 2014/12/15 02:29:25 I think some explanation here using comments or fu
xiang 2014/12/15 06:00:52 I added these comments. I think a IsUsingRegistrat
falken 2014/12/15 06:18:01 My imagination was something like { return associa
falken 2014/12/15 06:20:20 Ah I totally missed the point of your comment. OK,
88 return;
87 ServiceWorkerVersion* active_version = registration->active_version(); 89 ServiceWorkerVersion* active_version = registration->active_version();
88 DCHECK_EQ(active_version->status(), ServiceWorkerVersion::ACTIVATING); 90 DCHECK_EQ(active_version->status(), ServiceWorkerVersion::ACTIVATING);
89 SetControllerVersionAttribute(active_version); 91 SetControllerVersionAttribute(active_version);
90 } 92 }
91 93
92 void ServiceWorkerProviderHost::SetDocumentUrl(const GURL& url) { 94 void ServiceWorkerProviderHost::SetDocumentUrl(const GURL& url) {
93 DCHECK(!url.has_ref()); 95 DCHECK(!url.has_ref());
94 document_url_ = url; 96 document_url_ = url;
95 } 97 }
96 98
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 context_->process_manager()->RemoveProcessReferenceFromPattern( 347 context_->process_manager()->RemoveProcessReferenceFromPattern(
346 pattern, render_process_id_); 348 pattern, render_process_id_);
347 } 349 }
348 } 350 }
349 351
350 bool ServiceWorkerProviderHost::IsContextAlive() { 352 bool ServiceWorkerProviderHost::IsContextAlive() {
351 return context_ != NULL; 353 return context_ != NULL;
352 } 354 }
353 355
354 } // namespace content 356 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698