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_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 86400 | |
| 189 // seconds (24 hours) have passed since the last update, bypasses the browser | |
|
falken
2015/10/01 12:31:48
"86400 seconds" seems like trivia not useful in th
jungkees
2015/10/02 06:19:19
Done.
| |
| 190 // cache. | |
| 186 void UpdateServiceWorker(ServiceWorkerRegistration* registration, | 191 void UpdateServiceWorker(ServiceWorkerRegistration* registration, |
| 187 bool force_bypass_cache); | 192 bool force_bypass_cache); |
| 188 void UpdateServiceWorker(ServiceWorkerRegistration* registration, | 193 void UpdateServiceWorker(ServiceWorkerRegistration* registration, |
| 189 bool force_bypass_cache, | 194 bool force_bypass_cache, |
| 190 ServiceWorkerProviderHost* provider_host, | 195 ServiceWorkerProviderHost* provider_host, |
| 191 const UpdateCallback& callback); | 196 const UpdateCallback& callback); |
| 192 | 197 |
| 193 // This class maintains collections of live instances, this class | 198 // This class maintains collections of live instances, this class |
| 194 // does not own these object or influence their lifetime. | 199 // does not own these object or influence their lifetime. |
| 195 ServiceWorkerRegistration* GetLiveRegistration(int64 registration_id); | 200 ServiceWorkerRegistration* GetLiveRegistration(int64 registration_id); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 290 scoped_refptr<base::ObserverListThreadSafe<ServiceWorkerContextObserver>> | 295 scoped_refptr<base::ObserverListThreadSafe<ServiceWorkerContextObserver>> |
| 291 observer_list_; | 296 observer_list_; |
| 292 base::WeakPtrFactory<ServiceWorkerContextCore> weak_factory_; | 297 base::WeakPtrFactory<ServiceWorkerContextCore> weak_factory_; |
| 293 | 298 |
| 294 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextCore); | 299 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextCore); |
| 295 }; | 300 }; |
| 296 | 301 |
| 297 } // namespace content | 302 } // namespace content |
| 298 | 303 |
| 299 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CORE_H_ | 304 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CORE_H_ |
| OLD | NEW |