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 18 matching lines...) Expand all Loading... |
29 // two pages that are registering the same pattern at the same time | 29 // two pages that are registering the same pattern at the same time |
30 // have their registrations coalesced rather than overwriting each | 30 // have their registrations coalesced rather than overwriting each |
31 // other. | 31 // other. |
32 // | 32 // |
33 // This class also manages the state of the upgrade process, which | 33 // This class also manages the state of the upgrade process, which |
34 // includes managing which ServiceWorkerVersion is "active" vs "in | 34 // includes managing which ServiceWorkerVersion is "active" vs "in |
35 // waiting". | 35 // waiting". |
36 class CONTENT_EXPORT ServiceWorkerRegistration | 36 class CONTENT_EXPORT ServiceWorkerRegistration |
37 : NON_EXPORTED_BASE(public base::RefCounted<ServiceWorkerRegistration>) { | 37 : NON_EXPORTED_BASE(public base::RefCounted<ServiceWorkerRegistration>) { |
38 public: | 38 public: |
39 | |
40 class Listener { | 39 class Listener { |
41 public: | 40 public: |
42 virtual void OnVersionAttributesChanged( | 41 virtual void OnVersionAttributesChanged( |
43 ServiceWorkerRegistration* registration, | 42 ServiceWorkerRegistration* registration, |
44 ChangedVersionAttributesMask changed_mask, | 43 ChangedVersionAttributesMask changed_mask, |
45 const ServiceWorkerRegistrationInfo& info) = 0; | 44 const ServiceWorkerRegistrationInfo& info) = 0; |
46 }; | 45 }; |
47 | 46 |
48 ServiceWorkerRegistration(const GURL& pattern, | 47 ServiceWorkerRegistration(const GURL& pattern, |
49 const GURL& script_url, | 48 const GURL& script_url, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 scoped_refptr<ServiceWorkerVersion> active_version_; | 100 scoped_refptr<ServiceWorkerVersion> active_version_; |
102 scoped_refptr<ServiceWorkerVersion> waiting_version_; | 101 scoped_refptr<ServiceWorkerVersion> waiting_version_; |
103 scoped_refptr<ServiceWorkerVersion> installing_version_; | 102 scoped_refptr<ServiceWorkerVersion> installing_version_; |
104 ObserverList<Listener> listeners_; | 103 ObserverList<Listener> listeners_; |
105 base::WeakPtr<ServiceWorkerContextCore> context_; | 104 base::WeakPtr<ServiceWorkerContextCore> context_; |
106 | 105 |
107 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); | 106 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); |
108 }; | 107 }; |
109 } // namespace content | 108 } // namespace content |
110 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 109 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
OLD | NEW |