Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(746)

Unified Diff: content/browser/push_messaging/push_messaging_router.h

Issue 1579413004: Move push event dispatching out of ServiceWorkerVersion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix DispatchSimpleEvent comment Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/push_messaging/push_messaging_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..8cfa82c1294b520a51b58b5eae39ffbf1d3349bc 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,6 +56,15 @@ class PushMessagingRouter {
const scoped_refptr<ServiceWorkerRegistration>&
service_worker_registration);
+ // Delivers a push message with |data| to a specific |service_worker|. Must be
+ // called on the IO thread, with the the worker running.
+ 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 after the Service Worker has dispatched the push
// event. Must be called on the IO thread.
static void DeliverMessageEnd(
« no previous file with comments | « no previous file | content/browser/push_messaging/push_messaging_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698