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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 namespace content { | 47 namespace content { |
48 | 48 |
49 class EmbeddedWorkerRegistry; | 49 class EmbeddedWorkerRegistry; |
50 class ServiceWorkerContextCore; | 50 class ServiceWorkerContextCore; |
51 class ServiceWorkerProviderHost; | 51 class ServiceWorkerProviderHost; |
52 class ServiceWorkerRegistration; | 52 class ServiceWorkerRegistration; |
53 class ServiceWorkerURLRequestJob; | 53 class ServiceWorkerURLRequestJob; |
54 struct NavigatorConnectClient; | 54 struct NavigatorConnectClient; |
55 struct PlatformNotificationData; | 55 struct PlatformNotificationData; |
| 56 struct PushEventPayload; |
56 struct ServiceWorkerClientInfo; | 57 struct ServiceWorkerClientInfo; |
57 struct ServiceWorkerVersionInfo; | 58 struct ServiceWorkerVersionInfo; |
58 struct TransferredMessagePort; | 59 struct TransferredMessagePort; |
59 | 60 |
60 // This class corresponds to a specific version of a ServiceWorker | 61 // This class corresponds to a specific version of a ServiceWorker |
61 // script for a given pattern. When a script is upgraded, there may be | 62 // script for a given pattern. When a script is upgraded, there may be |
62 // more than one ServiceWorkerVersion "running" at a time, but only | 63 // more than one ServiceWorkerVersion "running" at a time, but only |
63 // one of them is activated. This class connects the actual script with a | 64 // one of them is activated. This class connects the actual script with a |
64 // running worker. | 65 // running worker. |
65 class CONTENT_EXPORT ServiceWorkerVersion | 66 class CONTENT_EXPORT ServiceWorkerVersion |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 int64_t persistent_notification_id, | 270 int64_t persistent_notification_id, |
270 const PlatformNotificationData& notification_data, | 271 const PlatformNotificationData& notification_data, |
271 int action_index); | 272 int action_index); |
272 | 273 |
273 // Sends push event to the associated embedded worker and asynchronously calls | 274 // Sends push event to the associated embedded worker and asynchronously calls |
274 // |callback| when it errors out or it gets a response from the worker to | 275 // |callback| when it errors out or it gets a response from the worker to |
275 // notify completion. | 276 // notify completion. |
276 // | 277 // |
277 // This must be called when the status() is ACTIVATED. | 278 // This must be called when the status() is ACTIVATED. |
278 void DispatchPushEvent(const StatusCallback& callback, | 279 void DispatchPushEvent(const StatusCallback& callback, |
279 const std::string& data); | 280 const content::PushEventPayload& payload); |
280 | 281 |
281 // Sends a cross origin message event to the associated embedded worker and | 282 // Sends a cross origin message event to the associated embedded worker and |
282 // asynchronously calls |callback| when the message was sent (or failed to | 283 // asynchronously calls |callback| when the message was sent (or failed to |
283 // sent). | 284 // sent). |
284 // It is the responsibility of the code calling this method to make sure that | 285 // It is the responsibility of the code calling this method to make sure that |
285 // any transferred message ports are put on hold while potentially a process | 286 // any transferred message ports are put on hold while potentially a process |
286 // for the service worker is spun up. | 287 // for the service worker is spun up. |
287 // | 288 // |
288 // This must be called when the status() is ACTIVATED. | 289 // This must be called when the status() is ACTIVATED. |
289 void DispatchCrossOriginMessageEvent( | 290 void DispatchCrossOriginMessageEvent( |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 if (!ResponseMessage::Dispatch(&message, &callback_, this, param, | 824 if (!ResponseMessage::Dispatch(&message, &callback_, this, param, |
824 &CallbackType::Run)) | 825 &CallbackType::Run)) |
825 message.set_dispatch_error(); | 826 message.set_dispatch_error(); |
826 | 827 |
827 return true; | 828 return true; |
828 } | 829 } |
829 | 830 |
830 } // namespace content | 831 } // namespace content |
831 | 832 |
832 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 833 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
OLD | NEW |