| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // The |callback| will be also fired with an error code if the worker | 115 // The |callback| will be also fired with an error code if the worker |
| 116 // is unexpectedly (being) stopped. | 116 // is unexpectedly (being) stopped. |
| 117 // If the worker is not running this first tries to start it by | 117 // If the worker is not running this first tries to start it by |
| 118 // calling StartWorker internally. | 118 // calling StartWorker internally. |
| 119 void SendMessageAndRegisterCallback(const IPC::Message& message, | 119 void SendMessageAndRegisterCallback(const IPC::Message& message, |
| 120 const MessageCallback& callback); | 120 const MessageCallback& callback); |
| 121 | 121 |
| 122 // Sends install event to the associated embedded worker and asynchronously | 122 // Sends install event to the associated embedded worker and asynchronously |
| 123 // calls |callback| when it errors out or it gets response from the worker | 123 // calls |callback| when it errors out or it gets response from the worker |
| 124 // to notify install completion. | 124 // to notify install completion. |
| 125 // |active_version_embedded_worker_id| must be a valid positive ID | 125 // |active_version_id| must be a valid positive ID |
| 126 // if there's an active (previous) version running. | 126 // if there's an active (previous) version running. |
| 127 // | 127 // |
| 128 // This must be called when the status() is NEW. Calling this changes | 128 // This must be called when the status() is NEW. Calling this changes |
| 129 // the version's status to INSTALLING. | 129 // the version's status to INSTALLING. |
| 130 // Upon completion, the version's status will be changed to INSTALLED | 130 // Upon completion, the version's status will be changed to INSTALLED |
| 131 // on success, or back to NEW on failure. | 131 // on success, or back to NEW on failure. |
| 132 void DispatchInstallEvent(int active_version_embedded_worker_id, | 132 void DispatchInstallEvent(int active_version_id, |
| 133 const StatusCallback& callback); | 133 const StatusCallback& callback); |
| 134 | 134 |
| 135 // Sends activate event to the associated embedded worker and asynchronously | 135 // Sends activate event to the associated embedded worker and asynchronously |
| 136 // calls |callback| when it errors out or it gets response from the worker | 136 // calls |callback| when it errors out or it gets response from the worker |
| 137 // to notify activation completion. | 137 // to notify activation completion. |
| 138 // | 138 // |
| 139 // This must be called when the status() is INSTALLED. Calling this changes | 139 // This must be called when the status() is INSTALLED. Calling this changes |
| 140 // the version's status to ACTIVATING. | 140 // the version's status to ACTIVATING. |
| 141 // Upon completion, the version's status will be changed to ACTIVE | 141 // Upon completion, the version's status will be changed to ACTIVE |
| 142 // on success, or back to INSTALLED on failure. | 142 // on success, or back to INSTALLED on failure. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 IDMap<MessageCallback, IDMapOwnPointer> message_callbacks_; | 187 IDMap<MessageCallback, IDMapOwnPointer> message_callbacks_; |
| 188 | 188 |
| 189 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 189 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
| 190 | 190 |
| 191 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 191 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
| 192 }; | 192 }; |
| 193 | 193 |
| 194 } // namespace content | 194 } // namespace content |
| 195 | 195 |
| 196 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 196 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| OLD | NEW |