| Index: Source/web/ServiceWorkerGlobalScopeProxy.cpp
|
| diff --git a/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/Source/web/ServiceWorkerGlobalScopeProxy.cpp
|
| index 7ec351264510c662e970a194a3fbe2fe85e73683..51b2889a9217ccc79c4a350e62b0b8aa6f784f7f 100644
|
| --- a/Source/web/ServiceWorkerGlobalScopeProxy.cpp
|
| +++ b/Source/web/ServiceWorkerGlobalScopeProxy.cpp
|
| @@ -41,6 +41,7 @@
|
| #include "core/workers/WorkerGlobalScope.h"
|
| #include "modules/geofencing/CircularGeofencingRegion.h"
|
| #include "modules/geofencing/GeofencingEvent.h"
|
| +#include "modules/notifications/NotificationEvent.h"
|
| #include "modules/push_messaging/PushEvent.h"
|
| #include "modules/serviceworkers/ExtendableEvent.h"
|
| #include "modules/serviceworkers/FetchEvent.h"
|
| @@ -48,6 +49,7 @@
|
| #include "modules/serviceworkers/ServiceWorkerGlobalScope.h"
|
| #include "modules/serviceworkers/WaitUntilObserver.h"
|
| #include "platform/RuntimeEnabledFeatures.h"
|
| +#include "public/platform/WebNotificationData.h"
|
| #include "public/platform/WebServiceWorkerEventResult.h"
|
| #include "public/platform/WebServiceWorkerRequest.h"
|
| #include "public/web/WebSerializedScriptValue.h"
|
| @@ -67,14 +69,6 @@ ServiceWorkerGlobalScopeProxy::~ServiceWorkerGlobalScopeProxy()
|
| {
|
| }
|
|
|
| -void ServiceWorkerGlobalScopeProxy::dispatchInstallEvent(int eventID)
|
| -{
|
| - ASSERT(m_workerGlobalScope);
|
| - WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::Install, eventID);
|
| - RefPtrWillBeRawPtr<Event> event(InstallEvent::create(EventTypeNames::install, EventInit(), observer));
|
| - m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer);
|
| -}
|
| -
|
| void ServiceWorkerGlobalScopeProxy::dispatchActivateEvent(int eventID)
|
| {
|
| ASSERT(m_workerGlobalScope);
|
| @@ -106,6 +100,14 @@ void ServiceWorkerGlobalScopeProxy::dispatchGeofencingEvent(int eventID, WebGeof
|
| m_workerGlobalScope->dispatchEvent(GeofencingEvent::create(type, regionID, CircularGeofencingRegion::create(regionID, region)));
|
| }
|
|
|
| +void ServiceWorkerGlobalScopeProxy::dispatchInstallEvent(int eventID)
|
| +{
|
| + ASSERT(m_workerGlobalScope);
|
| + WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::Install, eventID);
|
| + RefPtrWillBeRawPtr<Event> event(InstallEvent::create(EventTypeNames::install, EventInit(), observer));
|
| + m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer);
|
| +}
|
| +
|
| void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& message, const WebMessagePortChannelArray& webChannels)
|
| {
|
| ASSERT(m_workerGlobalScope);
|
| @@ -115,6 +117,26 @@ void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& messag
|
| m_workerGlobalScope->dispatchEvent(MessageEvent::create(ports.release(), value));
|
| }
|
|
|
| +void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent(int eventID, const WebNotificationData& data)
|
| +{
|
| + ASSERT(m_workerGlobalScope);
|
| + WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::NotificationClick, eventID);
|
| + // FIXME: Initialize a Notification object based on |data|.
|
| + NotificationEventInit eventInit;
|
| + RefPtrWillBeRawPtr<Event> event(NotificationEvent::create(EventTypeNames::notificationclick, eventInit, observer));
|
| + m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer);
|
| +}
|
| +
|
| +void ServiceWorkerGlobalScopeProxy::dispatchNotificationErrorEvent(int eventID, const WebNotificationData& data)
|
| +{
|
| + ASSERT(m_workerGlobalScope);
|
| + WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::NotificationError, eventID);
|
| + // FIXME: Initialize a Notification object based on |data|.
|
| + NotificationEventInit eventInit;
|
| + RefPtrWillBeRawPtr<Event> event(NotificationEvent::create(EventTypeNames::notificationerror, eventInit, observer));
|
| + m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer);
|
| +}
|
| +
|
| void ServiceWorkerGlobalScopeProxy::dispatchPushEvent(int eventID, const WebString& data)
|
| {
|
| ASSERT(m_workerGlobalScope);
|
|
|