| 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 "content/common/service_worker/service_worker_types.h" | 10 #include "content/common/service_worker/service_worker_types.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 return; | 70 return; |
| 71 provider_host_->SendServiceWorkerStateChangedMessage( | 71 provider_host_->SendServiceWorkerStateChangedMessage( |
| 72 handle_id_, GetWebServiceWorkerState(version)); | 72 handle_id_, GetWebServiceWorkerState(version)); |
| 73 } | 73 } |
| 74 | 74 |
| 75 ServiceWorkerObjectInfo ServiceWorkerHandle::GetObjectInfo() { | 75 ServiceWorkerObjectInfo ServiceWorkerHandle::GetObjectInfo() { |
| 76 ServiceWorkerObjectInfo info; | 76 ServiceWorkerObjectInfo info; |
| 77 info.handle_id = handle_id_; | 77 info.handle_id = handle_id_; |
| 78 info.url = version_->script_url(); | 78 info.url = version_->script_url(); |
| 79 info.state = GetWebServiceWorkerState(version_.get()); | 79 info.state = GetWebServiceWorkerState(version_.get()); |
| 80 info.version_id = version_->version_id(); | 80 info.version_uuid = version_->version_uuid(); |
| 81 return info; | 81 return info; |
| 82 } | 82 } |
| 83 | 83 |
| 84 void ServiceWorkerHandle::IncrementRefCount() { | 84 void ServiceWorkerHandle::IncrementRefCount() { |
| 85 DCHECK_GT(ref_count_, 0); | 85 DCHECK_GT(ref_count_, 0); |
| 86 ++ref_count_; | 86 ++ref_count_; |
| 87 } | 87 } |
| 88 | 88 |
| 89 void ServiceWorkerHandle::DecrementRefCount() { | 89 void ServiceWorkerHandle::DecrementRefCount() { |
| 90 DCHECK_GE(ref_count_, 0); | 90 DCHECK_GE(ref_count_, 0); |
| 91 --ref_count_; | 91 --ref_count_; |
| 92 } | 92 } |
| 93 | 93 |
| 94 } // namespace content | 94 } // namespace content |
| OLD | NEW |