| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_handle.h" | 5 #include "content/browser/service_worker/service_worker_handle.h" |
| 6 | 6 |
| 7 #include "content/browser/service_worker/service_worker_context_core.h" | 7 #include "content/browser/service_worker/service_worker_context_core.h" |
| 8 #include "content/browser/service_worker/service_worker_registration.h" | 8 #include "content/browser/service_worker/service_worker_registration.h" |
| 9 #include "content/common/service_worker/service_worker_messages.h" | 9 #include "content/common/service_worker/service_worker_messages.h" |
| 10 #include "ipc/ipc_sender.h" | 10 #include "ipc/ipc_sender.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 void ServiceWorkerHandle::OnVersionStateChanged(ServiceWorkerVersion* version) { | 104 void ServiceWorkerHandle::OnVersionStateChanged(ServiceWorkerVersion* version) { |
| 105 sender_->Send(new ServiceWorkerMsg_ServiceWorkerStateChanged( | 105 sender_->Send(new ServiceWorkerMsg_ServiceWorkerStateChanged( |
| 106 thread_id_, handle_id_, GetWebServiceWorkerState(version))); | 106 thread_id_, handle_id_, GetWebServiceWorkerState(version))); |
| 107 } | 107 } |
| 108 | 108 |
| 109 ServiceWorkerObjectInfo ServiceWorkerHandle::GetObjectInfo() { | 109 ServiceWorkerObjectInfo ServiceWorkerHandle::GetObjectInfo() { |
| 110 ServiceWorkerObjectInfo info; | 110 ServiceWorkerObjectInfo info; |
| 111 info.handle_id = handle_id_; | 111 info.handle_id = handle_id_; |
| 112 info.scope = registration_->pattern(); | 112 info.scope = registration_->pattern(); |
| 113 info.url = registration_->script_url(); | 113 info.url = version_->script_url(); |
| 114 info.state = GetWebServiceWorkerState(version_); | 114 info.state = GetWebServiceWorkerState(version_); |
| 115 return info; | 115 return info; |
| 116 } | 116 } |
| 117 | 117 |
| 118 void ServiceWorkerHandle::IncrementRefCount() { | 118 void ServiceWorkerHandle::IncrementRefCount() { |
| 119 DCHECK_GT(ref_count_, 0); | 119 DCHECK_GT(ref_count_, 0); |
| 120 ++ref_count_; | 120 ++ref_count_; |
| 121 } | 121 } |
| 122 | 122 |
| 123 void ServiceWorkerHandle::DecrementRefCount() { | 123 void ServiceWorkerHandle::DecrementRefCount() { |
| 124 DCHECK_GE(ref_count_, 0); | 124 DCHECK_GE(ref_count_, 0); |
| 125 --ref_count_; | 125 --ref_count_; |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace content | 128 } // namespace content |
| OLD | NEW |