OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "content/browser/service_worker/service_worker_version.h" | 13 #include "content/browser/service_worker/service_worker_version.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "content/common/service_worker/service_worker_types.h" | 15 #include "content/common/service_worker/service_worker_types.h" |
16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 class ServiceWorkerRegistrationInfo; | 20 class ServiceWorkerRegistrationInfo; |
21 class ServiceWorkerVersion; | 21 class ServiceWorkerVersion; |
22 | 22 |
23 // This class represents a service worker registration. The | 23 // This class represents a service worker registration. The |
24 // scope and script url are constant for the life of the persistent | 24 // scope and script url are constant for the life of the persistent |
25 // registration. It's refcounted to facillitate multiple controllees | 25 // registration. It's refcounted to facillitate multiple controllees |
26 // being associated with the same registration. The class roughly | 26 // being associated with the same registration. The class roughly |
27 // corresponds to navigator.serviceWorker.registgration. | 27 // corresponds to navigator.serviceWorker.registration. |
28 class CONTENT_EXPORT ServiceWorkerRegistration | 28 class CONTENT_EXPORT ServiceWorkerRegistration |
29 : NON_EXPORTED_BASE(public base::RefCounted<ServiceWorkerRegistration>) { | 29 : NON_EXPORTED_BASE(public base::RefCounted<ServiceWorkerRegistration>) { |
30 public: | 30 public: |
31 typedef base::Callback<void(ServiceWorkerStatusCode status)> StatusCallback; | 31 typedef base::Callback<void(ServiceWorkerStatusCode status)> StatusCallback; |
32 | 32 |
33 class Listener { | 33 class Listener { |
34 public: | 34 public: |
35 virtual void OnVersionAttributesChanged( | 35 virtual void OnVersionAttributesChanged( |
36 ServiceWorkerRegistration* registration, | 36 ServiceWorkerRegistration* registration, |
37 ChangedVersionAttributesMask changed_mask, | 37 ChangedVersionAttributesMask changed_mask, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 scoped_refptr<ServiceWorkerVersion> active_version_; | 103 scoped_refptr<ServiceWorkerVersion> active_version_; |
104 scoped_refptr<ServiceWorkerVersion> waiting_version_; | 104 scoped_refptr<ServiceWorkerVersion> waiting_version_; |
105 scoped_refptr<ServiceWorkerVersion> installing_version_; | 105 scoped_refptr<ServiceWorkerVersion> installing_version_; |
106 ObserverList<Listener> listeners_; | 106 ObserverList<Listener> listeners_; |
107 base::WeakPtr<ServiceWorkerContextCore> context_; | 107 base::WeakPtr<ServiceWorkerContextCore> context_; |
108 | 108 |
109 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); | 109 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); |
110 }; | 110 }; |
111 } // namespace content | 111 } // namespace content |
112 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 112 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
OLD | NEW |