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

Unified Diff: Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 318413002: Push API: define push event on Service Worker. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | « Source/web/ServiceWorkerGlobalScopeProxy.h ('k') | public/web/WebServiceWorkerContextProxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/ServiceWorkerGlobalScopeProxy.cpp
diff --git a/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/Source/web/ServiceWorkerGlobalScopeProxy.cpp
index 8cd0d7767f1f9f89cb22ae6e250353c47e9dde8c..876598546fd634c6d81abccf7ccb09beb79d5908 100644
--- a/Source/web/ServiceWorkerGlobalScopeProxy.cpp
+++ b/Source/web/ServiceWorkerGlobalScopeProxy.cpp
@@ -36,6 +36,7 @@
#include "core/dom/MessagePort.h"
#include "core/events/MessageEvent.h"
#include "core/workers/WorkerGlobalScope.h"
+#include "modules/push_messaging/PushEvent.h"
#include "modules/serviceworkers/FetchEvent.h"
#include "modules/serviceworkers/InstallEvent.h"
#include "modules/serviceworkers/InstallPhaseEvent.h"
@@ -96,6 +97,12 @@ void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& messag
m_workerGlobalScope->dispatchEvent(MessageEvent::create(ports.release(), value));
}
+void ServiceWorkerGlobalScopeProxy::dispatchPushEvent(int eventID, const WebString& data)
+{
+ ASSERT(m_workerGlobalScope);
+ m_workerGlobalScope->dispatchEvent(PushEvent::create(EventTypeNames::push, data));
+}
+
void ServiceWorkerGlobalScopeProxy::dispatchSyncEvent(int eventID)
{
ASSERT(m_workerGlobalScope);
« no previous file with comments | « Source/web/ServiceWorkerGlobalScopeProxy.h ('k') | public/web/WebServiceWorkerContextProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698