Chromium Code Reviews| 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_PROVIDER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 UpdateAfter24Hours); | 115 UpdateAfter24Hours); |
| 116 | 116 |
| 117 // ServiceWorkerRegistration::Listener overrides. | 117 // ServiceWorkerRegistration::Listener overrides. |
| 118 virtual void OnVersionAttributesChanged( | 118 virtual void OnVersionAttributesChanged( |
| 119 ServiceWorkerRegistration* registration, | 119 ServiceWorkerRegistration* registration, |
| 120 ChangedVersionAttributesMask changed_mask, | 120 ChangedVersionAttributesMask changed_mask, |
| 121 const ServiceWorkerRegistrationInfo& info) OVERRIDE; | 121 const ServiceWorkerRegistrationInfo& info) OVERRIDE; |
| 122 virtual void OnRegistrationFailed( | 122 virtual void OnRegistrationFailed( |
| 123 ServiceWorkerRegistration* registration) OVERRIDE; | 123 ServiceWorkerRegistration* registration) OVERRIDE; |
| 124 | 124 |
| 125 // Sets the corresponding version field to the given version or if the given | 125 // Adds this provider host to the potential controllee list of the given |
| 126 // version is NULL, clears the field. | 126 // versions and removes from one of the previous versions. |
|
falken
2014/08/22 09:04:36
I think "and removes it from the previous versions
nhiroki
2014/08/22 10:35:17
Done.
| |
| 127 void SetVersionAttributes( | 127 void UpdatePotentialControllees( |
| 128 ServiceWorkerVersion* installing_version, | 128 ServiceWorkerVersion* installing_version, |
| 129 ServiceWorkerVersion* waiting_version, | 129 ServiceWorkerVersion* waiting_version, |
| 130 ServiceWorkerVersion* active_version); | 130 ServiceWorkerVersion* active_version); |
| 131 void SetVersionAttributesInternal( | |
| 132 ServiceWorkerVersion* version, | |
| 133 scoped_refptr<ServiceWorkerVersion>* data_member); | |
| 134 | 131 |
| 135 // Sets the controller version field to |version| or if |version| is NULL, | 132 // Sets the controller version field to |version| or if |version| is NULL, |
| 136 // clears the field. | 133 // clears the field. |
| 137 void SetControllerVersionAttribute(ServiceWorkerVersion* version); | 134 void SetControllerVersionAttribute(ServiceWorkerVersion* version); |
| 138 | 135 |
| 139 // Clears all version fields. | |
| 140 void ClearVersionAttributes(); | |
| 141 | |
| 142 // Creates a ServiceWorkerHandle to retain |version| and returns a | 136 // Creates a ServiceWorkerHandle to retain |version| and returns a |
| 143 // ServiceWorkerInfo with the handle ID to pass to the provider. The | 137 // ServiceWorkerInfo with the handle ID to pass to the provider. The |
| 144 // provider is responsible for releasing the handle. | 138 // provider is responsible for releasing the handle. |
| 145 ServiceWorkerObjectInfo CreateHandleAndPass(ServiceWorkerVersion* version); | 139 ServiceWorkerObjectInfo CreateHandleAndPass(ServiceWorkerVersion* version); |
| 146 | 140 |
| 147 const int process_id_; | 141 const int process_id_; |
| 148 const int provider_id_; | 142 const int provider_id_; |
| 149 GURL document_url_; | 143 GURL document_url_; |
| 150 | 144 |
| 151 scoped_refptr<ServiceWorkerRegistration> associated_registration_; | 145 scoped_refptr<ServiceWorkerRegistration> associated_registration_; |
| 152 | 146 |
| 153 scoped_refptr<ServiceWorkerVersion> controlling_version_; | 147 scoped_refptr<ServiceWorkerVersion> controlling_version_; |
| 154 scoped_refptr<ServiceWorkerVersion> active_version_; | 148 scoped_refptr<ServiceWorkerVersion> active_version_; |
| 155 scoped_refptr<ServiceWorkerVersion> waiting_version_; | 149 scoped_refptr<ServiceWorkerVersion> waiting_version_; |
| 156 scoped_refptr<ServiceWorkerVersion> installing_version_; | 150 scoped_refptr<ServiceWorkerVersion> installing_version_; |
| 157 scoped_refptr<ServiceWorkerVersion> running_hosted_version_; | 151 scoped_refptr<ServiceWorkerVersion> running_hosted_version_; |
| 158 base::WeakPtr<ServiceWorkerContextCore> context_; | 152 base::WeakPtr<ServiceWorkerContextCore> context_; |
| 159 ServiceWorkerDispatcherHost* dispatcher_host_; | 153 ServiceWorkerDispatcherHost* dispatcher_host_; |
| 160 | 154 |
| 161 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); | 155 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); |
| 162 }; | 156 }; |
| 163 | 157 |
| 164 } // namespace content | 158 } // namespace content |
| 165 | 159 |
| 166 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 160 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
| OLD | NEW |