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/child/service_worker/service_worker_registration_handle_refere
nce.h" | 5 #include "content/child/service_worker/service_worker_registration_handle_refere
nce.h" |
6 | 6 |
7 #include "content/child/thread_safe_sender.h" | 7 #include "content/child/thread_safe_sender.h" |
8 #include "content/common/service_worker/service_worker_messages.h" | 8 #include "content/common/service_worker/service_worker_messages.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
(...skipping 15 matching lines...) Expand all Loading... |
26 } | 26 } |
27 | 27 |
28 ServiceWorkerRegistrationHandleReference:: | 28 ServiceWorkerRegistrationHandleReference:: |
29 ServiceWorkerRegistrationHandleReference( | 29 ServiceWorkerRegistrationHandleReference( |
30 const ServiceWorkerRegistrationObjectInfo& info, | 30 const ServiceWorkerRegistrationObjectInfo& info, |
31 ThreadSafeSender* sender, | 31 ThreadSafeSender* sender, |
32 bool increment_ref_in_ctor) | 32 bool increment_ref_in_ctor) |
33 : info_(info), | 33 : info_(info), |
34 sender_(sender) { | 34 sender_(sender) { |
35 DCHECK_NE(kInvalidServiceWorkerRegistrationHandleId, info_.handle_id); | 35 DCHECK_NE(kInvalidServiceWorkerRegistrationHandleId, info_.handle_id); |
36 DCHECK(sender_); | 36 DCHECK(sender_.get()); |
37 if (increment_ref_in_ctor) | 37 if (increment_ref_in_ctor) |
38 return; | 38 return; |
39 sender_->Send( | 39 sender_->Send( |
40 new ServiceWorkerHostMsg_IncrementRegistrationRefCount(info_.handle_id)); | 40 new ServiceWorkerHostMsg_IncrementRegistrationRefCount(info_.handle_id)); |
41 } | 41 } |
42 | 42 |
43 ServiceWorkerRegistrationHandleReference:: | 43 ServiceWorkerRegistrationHandleReference:: |
44 ~ServiceWorkerRegistrationHandleReference() { | 44 ~ServiceWorkerRegistrationHandleReference() { |
45 sender_->Send( | 45 sender_->Send( |
46 new ServiceWorkerHostMsg_DecrementRegistrationRefCount(info_.handle_id)); | 46 new ServiceWorkerHostMsg_DecrementRegistrationRefCount(info_.handle_id)); |
47 } | 47 } |
48 | 48 |
49 } // namespace content | 49 } // namespace content |
OLD | NEW |