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 #ifndef CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_REFERENC
E_H_ | 5 #ifndef CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_REFERENC
E_H_ |
6 #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_REFERENC
E_H_ | 6 #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_REFERENC
E_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/common/service_worker/service_worker_types.h" | 10 #include "content/common/service_worker/service_worker_types.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 ThreadSafeSender* sender); | 23 ThreadSafeSender* sender); |
24 | 24 |
25 // Creates a new ServiceWorkerRegistrationHandleReference by adopting a | 25 // Creates a new ServiceWorkerRegistrationHandleReference by adopting a |
26 // ref-count. | 26 // ref-count. |
27 static scoped_ptr<ServiceWorkerRegistrationHandleReference> Adopt( | 27 static scoped_ptr<ServiceWorkerRegistrationHandleReference> Adopt( |
28 const ServiceWorkerRegistrationObjectInfo& info, | 28 const ServiceWorkerRegistrationObjectInfo& info, |
29 ThreadSafeSender* sender); | 29 ThreadSafeSender* sender); |
30 | 30 |
31 ~ServiceWorkerRegistrationHandleReference(); | 31 ~ServiceWorkerRegistrationHandleReference(); |
32 | 32 |
| 33 const ServiceWorkerRegistrationObjectInfo& info() const { return info_; } |
33 int handle_id() const { return info_.handle_id; } | 34 int handle_id() const { return info_.handle_id; } |
34 GURL scope() const { return info_.scope; } | 35 GURL scope() const { return info_.scope; } |
35 | 36 |
36 private: | 37 private: |
37 ServiceWorkerRegistrationHandleReference( | 38 ServiceWorkerRegistrationHandleReference( |
38 const ServiceWorkerRegistrationObjectInfo& info, | 39 const ServiceWorkerRegistrationObjectInfo& info, |
39 ThreadSafeSender* sender, | 40 ThreadSafeSender* sender, |
40 bool increment_ref_in_ctor); | 41 bool increment_ref_in_ctor); |
41 | 42 |
42 ServiceWorkerRegistrationObjectInfo info_; | 43 ServiceWorkerRegistrationObjectInfo info_; |
43 scoped_refptr<ThreadSafeSender> sender_; | 44 scoped_refptr<ThreadSafeSender> sender_; |
44 | 45 |
45 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistrationHandleReference); | 46 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistrationHandleReference); |
46 }; | 47 }; |
47 | 48 |
48 } // namespace content | 49 } // namespace content |
49 | 50 |
50 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_REFER
ENCE_H_ | 51 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_REFER
ENCE_H_ |
OLD | NEW |