Chromium Code Reviews| Index: content/browser/push_messaging/push_messaging_router.h |
| diff --git a/content/browser/push_messaging/push_messaging_router.h b/content/browser/push_messaging/push_messaging_router.h |
| index dae9973de2627030fd2c66440d4a3b7434b48b51..9920aeec9c7ccbb33de7bd119dce78641d784594 100644 |
| --- a/content/browser/push_messaging/push_messaging_router.h |
| +++ b/content/browser/push_messaging/push_messaging_router.h |
| @@ -12,6 +12,7 @@ |
| #include "base/memory/weak_ptr.h" |
| #include "content/common/service_worker/service_worker_status_code.h" |
| #include "content/public/common/push_messaging_status.h" |
| +#include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerEventResult.h" |
| #include "url/gurl.h" |
| namespace content { |
| @@ -19,6 +20,7 @@ namespace content { |
| class BrowserContext; |
| class ServiceWorkerContextWrapper; |
| class ServiceWorkerRegistration; |
| +class ServiceWorkerVersion; |
| class PushMessagingRouter { |
| public: |
| @@ -54,14 +56,33 @@ class PushMessagingRouter { |
| const scoped_refptr<ServiceWorkerRegistration>& |
| service_worker_registration); |
| - // Gets called asynchronously after the Service Worker has dispatched the push |
| - // event. Must be called on the IO thread. |
| - static void DeliverMessageEnd( |
| + // Delivers a push message with |data| to a specific |service_worker|. Must be |
| + // called on the IO thread, with a the worker running. |
|
johnme
2016/01/22 14:35:37
s/a the/the/
Marijn Kruisselbrink
2016/01/23 00:02:19
Done
|
| + static void DeliverMessageToWorker( |
| + const scoped_refptr<ServiceWorkerVersion>& service_worker, |
| + const scoped_refptr<ServiceWorkerRegistration>& |
| + service_worker_registration, |
| + const std::string& data, |
| + const DeliverMessageCallback& deliver_message_callback); |
| + |
| + // Gets called asynchronously if dispatching a push event has failed. Must be |
| + // called on the IO thread. |
| + static void DeliverMessageFailed( |
| const DeliverMessageCallback& deliver_message_callback, |
| const scoped_refptr<ServiceWorkerRegistration>& |
| service_worker_registration, |
| ServiceWorkerStatusCode service_worker_status); |
| + // Gets called asynchronously after the Service Worker has dispatched the push |
| + // event with the result from the renderer. Must be called on the IO thread. |
| + static void DeliverMessageFinished( |
| + const DeliverMessageCallback& deliver_message_callback, |
| + const scoped_refptr<ServiceWorkerVersion>& service_worker, |
| + const scoped_refptr<ServiceWorkerRegistration>& |
| + service_worker_registration, |
| + int request_id, |
| + blink::WebServiceWorkerEventResult result); |
| + |
| DISALLOW_IMPLICIT_CONSTRUCTORS(PushMessagingRouter); |
| }; |