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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // Starts an update now. | 148 // Starts an update now. |
149 void StartUpdate(); | 149 void StartUpdate(); |
150 | 150 |
151 // Sends an IPC message to the worker. | 151 // Sends an IPC message to the worker. |
152 // If the worker is not running this first tries to start it by | 152 // If the worker is not running this first tries to start it by |
153 // calling StartWorker internally. | 153 // calling StartWorker internally. |
154 // |callback| can be null if the sender does not need to know if the | 154 // |callback| can be null if the sender does not need to know if the |
155 // message is successfully sent or not. | 155 // message is successfully sent or not. |
156 void SendMessage(const IPC::Message& message, const StatusCallback& callback); | 156 void SendMessage(const IPC::Message& message, const StatusCallback& callback); |
157 | 157 |
| 158 // Sends a message event to the associated embedded worker. |
| 159 void DispatchMessageEvent(const base::string16& message, |
| 160 const std::vector<int>& sent_message_port_ids, |
| 161 const StatusCallback& callback); |
| 162 |
158 // Sends install event to the associated embedded worker and asynchronously | 163 // Sends install event to the associated embedded worker and asynchronously |
159 // calls |callback| when it errors out or it gets a response from the worker | 164 // calls |callback| when it errors out or it gets a response from the worker |
160 // to notify install completion. | 165 // to notify install completion. |
161 // |active_version_id| must be a valid positive ID | 166 // |active_version_id| must be a valid positive ID |
162 // if there's an activated (previous) version running. | 167 // if there's an activated (previous) version running. |
163 // | 168 // |
164 // This must be called when the status() is NEW. Calling this changes | 169 // This must be called when the status() is NEW. Calling this changes |
165 // the version's status to INSTALLING. | 170 // the version's status to INSTALLING. |
166 // Upon completion, the version's status will be changed to INSTALLED | 171 // Upon completion, the version's status will be changed to INSTALLED |
167 // on success, or back to NEW on failure. | 172 // on success, or back to NEW on failure. |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 bool is_doomed_; | 320 bool is_doomed_; |
316 | 321 |
317 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 322 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
318 | 323 |
319 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 324 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
320 }; | 325 }; |
321 | 326 |
322 } // namespace content | 327 } // namespace content |
323 | 328 |
324 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 329 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
OLD | NEW |