| 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_VERSION_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // Upon completion, the version's status will be changed to ACTIVATED | 173 // Upon completion, the version's status will be changed to ACTIVATED |
| 174 // on success, or back to INSTALLED on failure. | 174 // on success, or back to INSTALLED on failure. |
| 175 void DispatchActivateEvent(const StatusCallback& callback); | 175 void DispatchActivateEvent(const StatusCallback& callback); |
| 176 | 176 |
| 177 // Sends fetch event to the associated embedded worker and calls | 177 // Sends fetch event to the associated embedded worker and calls |
| 178 // |callback| with the response from the worker. | 178 // |callback| with the response from the worker. |
| 179 // | 179 // |
| 180 // This must be called when the status() is ACTIVATED. Calling this in other | 180 // This must be called when the status() is ACTIVATED. Calling this in other |
| 181 // statuses will result in an error SERVICE_WORKER_ERROR_FAILED. | 181 // statuses will result in an error SERVICE_WORKER_ERROR_FAILED. |
| 182 void DispatchFetchEvent(const ServiceWorkerFetchRequest& request, | 182 void DispatchFetchEvent(const ServiceWorkerFetchRequest& request, |
| 183 const FetchCallback& callback); | 183 const base::Closure& prepare_callback, |
| 184 const FetchCallback& fetch_callback); |
| 184 | 185 |
| 185 // Sends sync event to the associated embedded worker and asynchronously calls | 186 // Sends sync event to the associated embedded worker and asynchronously calls |
| 186 // |callback| when it errors out or it gets response from the worker to notify | 187 // |callback| when it errors out or it gets response from the worker to notify |
| 187 // completion. | 188 // completion. |
| 188 // | 189 // |
| 189 // This must be called when the status() is ACTIVATED. | 190 // This must be called when the status() is ACTIVATED. |
| 190 void DispatchSyncEvent(const StatusCallback& callback); | 191 void DispatchSyncEvent(const StatusCallback& callback); |
| 191 | 192 |
| 192 // Sends push event to the associated embedded worker and asynchronously calls | 193 // Sends push event to the associated embedded worker and asynchronously calls |
| 193 // |callback| when it errors out or it gets response from the worker to notify | 194 // |callback| when it errors out or it gets response from the worker to notify |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 bool is_doomed_; | 308 bool is_doomed_; |
| 308 | 309 |
| 309 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 310 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
| 310 | 311 |
| 311 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 312 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
| 312 }; | 313 }; |
| 313 | 314 |
| 314 } // namespace content | 315 } // namespace content |
| 315 | 316 |
| 316 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 317 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| OLD | NEW |