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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 // focusing action was successful. | 137 // focusing action was successful. |
138 void Focus(const FocusCallback& callback); | 138 void Focus(const FocusCallback& callback); |
139 | 139 |
140 // Asks the renderer to send back the document information. | 140 // Asks the renderer to send back the document information. |
141 void GetClientInfo(int embedded_worker_id, int request_id); | 141 void GetClientInfo(int embedded_worker_id, int request_id); |
142 | 142 |
143 // Adds reference of this host's process to the |pattern|, the reference will | 143 // Adds reference of this host's process to the |pattern|, the reference will |
144 // be removed in destructor. | 144 // be removed in destructor. |
145 void AddScopedProcessReferenceToPattern(const GURL& pattern); | 145 void AddScopedProcessReferenceToPattern(const GURL& pattern); |
146 | 146 |
147 // Set controller to the active version of associated registration. | |
falken
2015/01/29 15:10:37
nit: "Sets controller to the..."
| |
148 void ClaimedByNewVersion(); | |
149 | |
147 // Methods to support cross site navigations. | 150 // Methods to support cross site navigations. |
148 void PrepareForCrossSiteTransfer(); | 151 void PrepareForCrossSiteTransfer(); |
149 void CompleteCrossSiteTransfer( | 152 void CompleteCrossSiteTransfer( |
150 int new_process_id, | 153 int new_process_id, |
151 int new_frame_id, | 154 int new_frame_id, |
152 int new_provider_id, | 155 int new_provider_id, |
153 ServiceWorkerDispatcherHost* dispatcher_host); | 156 ServiceWorkerDispatcherHost* dispatcher_host); |
154 ServiceWorkerDispatcherHost* dispatcher_host() const { | 157 ServiceWorkerDispatcherHost* dispatcher_host() const { |
155 return dispatcher_host_; | 158 return dispatcher_host_; |
156 } | 159 } |
157 | 160 |
158 private: | 161 private: |
159 friend class ServiceWorkerProviderHostTest; | 162 friend class ServiceWorkerProviderHostTest; |
160 friend class ServiceWorkerWriteToCacheJobTest; | 163 friend class ServiceWorkerWriteToCacheJobTest; |
161 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerContextRequestHandlerTest, | 164 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerContextRequestHandlerTest, |
162 UpdateBefore24Hours); | 165 UpdateBefore24Hours); |
163 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerContextRequestHandlerTest, | 166 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerContextRequestHandlerTest, |
164 UpdateAfter24Hours); | 167 UpdateAfter24Hours); |
165 | 168 |
166 // ServiceWorkerRegistration::Listener overrides. | 169 // ServiceWorkerRegistration::Listener overrides. |
167 void OnRegistrationFailed(ServiceWorkerRegistration* registration) override; | 170 void OnRegistrationFailed(ServiceWorkerRegistration* registration) override; |
168 void OnSkippedWaiting(ServiceWorkerRegistration* registration) override; | 171 void OnSkippedWaiting(ServiceWorkerRegistration* registration) override; |
169 | 172 |
170 // Sets the controller version field to |version| or if |version| is NULL, | 173 // Sets the controller version field to |version| or if |version| is NULL, |
171 // clears the field. | 174 // clears the field. |
172 void SetControllerVersionAttribute(ServiceWorkerVersion* version); | 175 void SetControllerVersionAttribute(ServiceWorkerVersion* version); |
michaeln
2015/01/29 22:35:34
I think you can get rid of the ver->is_claiming_ f
| |
173 | 176 |
174 void SendAssociateRegistrationMessage(); | 177 void SendAssociateRegistrationMessage(); |
175 | 178 |
176 // Increase/decrease this host's process reference for |pattern|. | 179 // Increase/decrease this host's process reference for |pattern|. |
177 void IncreaseProcessReference(const GURL& pattern); | 180 void IncreaseProcessReference(const GURL& pattern); |
178 void DecreaseProcessReference(const GURL& pattern); | 181 void DecreaseProcessReference(const GURL& pattern); |
179 | 182 |
180 int render_process_id_; | 183 int render_process_id_; |
181 int render_frame_id_; | 184 int render_frame_id_; |
182 int provider_id_; | 185 int provider_id_; |
183 GURL document_url_; | 186 GURL document_url_; |
184 GURL topmost_frame_url_; | 187 GURL topmost_frame_url_; |
185 | 188 |
186 std::vector<GURL> associated_patterns_; | 189 std::vector<GURL> associated_patterns_; |
187 scoped_refptr<ServiceWorkerRegistration> associated_registration_; | 190 scoped_refptr<ServiceWorkerRegistration> associated_registration_; |
188 | 191 |
189 scoped_refptr<ServiceWorkerVersion> controlling_version_; | 192 scoped_refptr<ServiceWorkerVersion> controlling_version_; |
190 scoped_refptr<ServiceWorkerVersion> running_hosted_version_; | 193 scoped_refptr<ServiceWorkerVersion> running_hosted_version_; |
191 base::WeakPtr<ServiceWorkerContextCore> context_; | 194 base::WeakPtr<ServiceWorkerContextCore> context_; |
192 ServiceWorkerDispatcherHost* dispatcher_host_; | 195 ServiceWorkerDispatcherHost* dispatcher_host_; |
193 bool allow_association_; | 196 bool allow_association_; |
194 | 197 |
195 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); | 198 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); |
196 }; | 199 }; |
197 | 200 |
198 } // namespace content | 201 } // namespace content |
199 | 202 |
200 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 203 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
OLD | NEW |