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" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // Also notifies listeners via OnVersionAttributesChanged. | 76 // Also notifies listeners via OnVersionAttributesChanged. |
77 void SetActiveVersion(ServiceWorkerVersion* version); | 77 void SetActiveVersion(ServiceWorkerVersion* version); |
78 void SetWaitingVersion(ServiceWorkerVersion* version); | 78 void SetWaitingVersion(ServiceWorkerVersion* version); |
79 void SetInstallingVersion(ServiceWorkerVersion* version); | 79 void SetInstallingVersion(ServiceWorkerVersion* version); |
80 | 80 |
81 // If version is the installing, waiting, active version of this | 81 // If version is the installing, waiting, active version of this |
82 // registation, the method will reset that field to NULL, and notify | 82 // registation, the method will reset that field to NULL, and notify |
83 // listeners via OnVersionAttributesChanged. | 83 // listeners via OnVersionAttributesChanged. |
84 void UnsetVersion(ServiceWorkerVersion* version); | 84 void UnsetVersion(ServiceWorkerVersion* version); |
85 | 85 |
86 | |
87 private: | 86 private: |
88 ~ServiceWorkerRegistration(); | 87 ~ServiceWorkerRegistration(); |
89 friend class base::RefCounted<ServiceWorkerRegistration>; | 88 friend class base::RefCounted<ServiceWorkerRegistration>; |
90 | 89 |
91 void SetVersionInternal( | 90 void SetVersionInternal( |
92 ServiceWorkerVersion* version, | 91 ServiceWorkerVersion* version, |
93 scoped_refptr<ServiceWorkerVersion>* data_member, | 92 scoped_refptr<ServiceWorkerVersion>* data_member, |
94 int change_flag); | 93 int change_flag); |
95 void UnsetVersionInternal( | 94 void UnsetVersionInternal( |
96 ServiceWorkerVersion* version, | 95 ServiceWorkerVersion* version, |
97 ChangedVersionAttributesMask* mask); | 96 ChangedVersionAttributesMask* mask); |
98 | 97 |
99 const GURL pattern_; | 98 const GURL pattern_; |
100 const GURL script_url_; | 99 const GURL script_url_; |
101 const int64 registration_id_; | 100 const int64 registration_id_; |
102 scoped_refptr<ServiceWorkerVersion> active_version_; | 101 scoped_refptr<ServiceWorkerVersion> active_version_; |
103 scoped_refptr<ServiceWorkerVersion> waiting_version_; | 102 scoped_refptr<ServiceWorkerVersion> waiting_version_; |
104 scoped_refptr<ServiceWorkerVersion> installing_version_; | 103 scoped_refptr<ServiceWorkerVersion> installing_version_; |
105 ObserverList<Listener> listeners_; | 104 ObserverList<Listener> listeners_; |
106 base::WeakPtr<ServiceWorkerContextCore> context_; | 105 base::WeakPtr<ServiceWorkerContextCore> context_; |
107 | 106 |
108 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); | 107 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); |
109 }; | 108 }; |
110 } // namespace content | 109 } // namespace content |
111 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 110 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
OLD | NEW |