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_CONTEXT_CORE_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CORE_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CORE_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CORE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 // A child process of |source_process_id| may be used to run the created | 172 // A child process of |source_process_id| may be used to run the created |
173 // worker for initial installation. | 173 // worker for initial installation. |
174 // Non-null |provider_host| must be given if this is called from a document. | 174 // Non-null |provider_host| must be given if this is called from a document. |
175 void RegisterServiceWorker(const GURL& pattern, | 175 void RegisterServiceWorker(const GURL& pattern, |
176 const GURL& script_url, | 176 const GURL& script_url, |
177 ServiceWorkerProviderHost* provider_host, | 177 ServiceWorkerProviderHost* provider_host, |
178 const RegistrationCallback& callback); | 178 const RegistrationCallback& callback); |
179 void UnregisterServiceWorker(const GURL& pattern, | 179 void UnregisterServiceWorker(const GURL& pattern, |
180 const UnregistrationCallback& callback); | 180 const UnregistrationCallback& callback); |
| 181 |
181 // Callback is called issued after all unregistrations occur. The Status | 182 // Callback is called issued after all unregistrations occur. The Status |
182 // is populated as SERVICE_WORKER_OK if all succeed, or SERVICE_WORKER_FAILED | 183 // is populated as SERVICE_WORKER_OK if all succeed, or SERVICE_WORKER_FAILED |
183 // if any did not succeed. | 184 // if any did not succeed. |
184 void UnregisterServiceWorkers(const GURL& origin, | 185 void UnregisterServiceWorkers(const GURL& origin, |
185 const UnregistrationCallback& callback); | 186 const UnregistrationCallback& callback); |
| 187 |
| 188 // Updates the service worker. If |force_bypass_cache| is true or 24 hours |
| 189 // have passed since the last update, bypasses the browser cache. |
186 void UpdateServiceWorker(ServiceWorkerRegistration* registration, | 190 void UpdateServiceWorker(ServiceWorkerRegistration* registration, |
187 bool force_bypass_cache); | 191 bool force_bypass_cache); |
188 void UpdateServiceWorker(ServiceWorkerRegistration* registration, | 192 void UpdateServiceWorker(ServiceWorkerRegistration* registration, |
189 bool force_bypass_cache, | 193 bool force_bypass_cache, |
190 bool skip_script_comparison, | 194 bool skip_script_comparison, |
191 ServiceWorkerProviderHost* provider_host, | 195 ServiceWorkerProviderHost* provider_host, |
192 const UpdateCallback& callback); | 196 const UpdateCallback& callback); |
193 | 197 |
194 // Used in DevTools to update the service worker registration without | 198 // Used in DevTools to update the service worker registration without |
195 // consulting the browser cache while loading the controlled page. The loading | 199 // consulting the browser cache while loading the controlled page. The loading |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 scoped_refptr<base::ObserverListThreadSafe<ServiceWorkerContextObserver>> | 303 scoped_refptr<base::ObserverListThreadSafe<ServiceWorkerContextObserver>> |
300 observer_list_; | 304 observer_list_; |
301 base::WeakPtrFactory<ServiceWorkerContextCore> weak_factory_; | 305 base::WeakPtrFactory<ServiceWorkerContextCore> weak_factory_; |
302 | 306 |
303 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextCore); | 307 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextCore); |
304 }; | 308 }; |
305 | 309 |
306 } // namespace content | 310 } // namespace content |
307 | 311 |
308 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CORE_H_ | 312 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CORE_H_ |
OLD | NEW |