OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PUSH_MESSAGING_PUSH_MESSAGING_ROUTER_H_ | 5 #ifndef CONTENT_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_ROUTER_H_ |
6 #define CONTENT_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_ROUTER_H_ | 6 #define CONTENT_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_ROUTER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 const DeliverMessageCallback& deliver_message_callback, | 47 const DeliverMessageCallback& deliver_message_callback, |
48 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context); | 48 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context); |
49 | 49 |
50 // If a registration was successfully retrieved, dispatches a push event with | 50 // If a registration was successfully retrieved, dispatches a push event with |
51 // |data| on the Service Worker identified by |service_worker_registration|. | 51 // |data| on the Service Worker identified by |service_worker_registration|. |
52 // Must be called on the IO thread. | 52 // Must be called on the IO thread. |
53 static void FindServiceWorkerRegistrationCallback( | 53 static void FindServiceWorkerRegistrationCallback( |
54 const PushEventPayload& payload, | 54 const PushEventPayload& payload, |
55 const DeliverMessageCallback& deliver_message_callback, | 55 const DeliverMessageCallback& deliver_message_callback, |
56 ServiceWorkerStatusCode service_worker_status, | 56 ServiceWorkerStatusCode service_worker_status, |
57 const scoped_refptr<ServiceWorkerRegistration>& | 57 scoped_refptr<ServiceWorkerRegistration> service_worker_registration); |
58 service_worker_registration); | |
59 | 58 |
60 // Delivers a push message with |data| to a specific |service_worker|. Must be | 59 // Delivers a push message with |data| to a specific |service_worker|. Must be |
61 // called on the IO thread, with the the worker running. | 60 // called on the IO thread, with the the worker running. |
62 static void DeliverMessageToWorker( | 61 static void DeliverMessageToWorker( |
63 const scoped_refptr<ServiceWorkerVersion>& service_worker, | 62 const scoped_refptr<ServiceWorkerVersion>& service_worker, |
64 const scoped_refptr<ServiceWorkerRegistration>& | 63 const scoped_refptr<ServiceWorkerRegistration>& |
65 service_worker_registration, | 64 service_worker_registration, |
66 const PushEventPayload& payload, | 65 const PushEventPayload& payload, |
67 const DeliverMessageCallback& deliver_message_callback); | 66 const DeliverMessageCallback& deliver_message_callback); |
68 | 67 |
69 // Gets called asynchronously after the Service Worker has dispatched the push | 68 // Gets called asynchronously after the Service Worker has dispatched the push |
70 // event. Must be called on the IO thread. | 69 // event. Must be called on the IO thread. |
71 static void DeliverMessageEnd( | 70 static void DeliverMessageEnd( |
72 const DeliverMessageCallback& deliver_message_callback, | 71 const DeliverMessageCallback& deliver_message_callback, |
73 const scoped_refptr<ServiceWorkerRegistration>& | 72 const scoped_refptr<ServiceWorkerRegistration>& |
74 service_worker_registration, | 73 service_worker_registration, |
75 ServiceWorkerStatusCode service_worker_status); | 74 ServiceWorkerStatusCode service_worker_status); |
76 | 75 |
77 DISALLOW_IMPLICIT_CONSTRUCTORS(PushMessagingRouter); | 76 DISALLOW_IMPLICIT_CONSTRUCTORS(PushMessagingRouter); |
78 }; | 77 }; |
79 | 78 |
80 } // namespace content | 79 } // namespace content |
81 | 80 |
82 #endif // CONTENT_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_ROUTER_H_ | 81 #endif // CONTENT_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_ROUTER_H_ |
OLD | NEW |