OLD | NEW |
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 Loading... |
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 |
| 88 // worker of the registration. skipWaiting doesn't cause a client to start |
| 89 // using the registration. |
| 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 Loading... |
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 |
OLD | NEW |