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_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_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 "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 class ServiceWorkerRegistrationHandle | 26 class ServiceWorkerRegistrationHandle |
27 : public ServiceWorkerRegistration::Listener { | 27 : public ServiceWorkerRegistration::Listener { |
28 public: | 28 public: |
29 CONTENT_EXPORT ServiceWorkerRegistrationHandle( | 29 CONTENT_EXPORT ServiceWorkerRegistrationHandle( |
30 base::WeakPtr<ServiceWorkerContextCore> context, | 30 base::WeakPtr<ServiceWorkerContextCore> context, |
31 ServiceWorkerDispatcherHost* dispatcher_host, | 31 ServiceWorkerDispatcherHost* dispatcher_host, |
32 int provider_id, | 32 int provider_id, |
33 ServiceWorkerRegistration* registration); | 33 ServiceWorkerRegistration* registration); |
34 virtual ~ServiceWorkerRegistrationHandle(); | 34 virtual ~ServiceWorkerRegistrationHandle(); |
35 | 35 |
| 36 ServiceWorkerRegistrationObjectInfo GetObjectInfo(); |
| 37 |
36 bool HasNoRefCount() const { return ref_count_ <= 0; } | 38 bool HasNoRefCount() const { return ref_count_ <= 0; } |
37 void IncrementRefCount(); | 39 void IncrementRefCount(); |
38 void DecrementRefCount(); | 40 void DecrementRefCount(); |
39 | 41 |
40 int provider_id() const { return provider_id_; } | 42 int provider_id() const { return provider_id_; } |
41 int handle_id() const { return handle_id_; } | 43 int handle_id() const { return handle_id_; } |
42 | 44 |
43 ServiceWorkerRegistration* registration() { return registration_.get(); } | 45 ServiceWorkerRegistration* registration() { return registration_.get(); } |
44 | 46 |
45 private: | 47 private: |
(...skipping 28 matching lines...) Expand all Loading... |
74 scoped_refptr<ServiceWorkerVersion> installing_version_; | 76 scoped_refptr<ServiceWorkerVersion> installing_version_; |
75 scoped_refptr<ServiceWorkerVersion> waiting_version_; | 77 scoped_refptr<ServiceWorkerVersion> waiting_version_; |
76 scoped_refptr<ServiceWorkerVersion> active_version_; | 78 scoped_refptr<ServiceWorkerVersion> active_version_; |
77 | 79 |
78 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistrationHandle); | 80 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistrationHandle); |
79 }; | 81 }; |
80 | 82 |
81 } // namespace content | 83 } // namespace content |
82 | 84 |
83 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_H_ | 85 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_H_ |
OLD | NEW |