| Index: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
|
| diff --git a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
|
| index 2b130e66be030703ee5766ac85f774426aa204d3..87b0531c2fa0dcc1bf616b42e4378bd393bce1ea 100644
|
| --- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
|
| +++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
|
| @@ -46,6 +46,10 @@
|
| #include "modules/background_fetch/BackgroundFetchClickEventInit.h"
|
| #include "modules/background_fetch/BackgroundFetchEvent.h"
|
| #include "modules/background_fetch/BackgroundFetchEventInit.h"
|
| +#include "modules/background_fetch/BackgroundFetchFailEvent.h"
|
| +#include "modules/background_fetch/BackgroundFetchFailEventInit.h"
|
| +#include "modules/background_fetch/BackgroundFetchedEvent.h"
|
| +#include "modules/background_fetch/BackgroundFetchedEventInit.h"
|
| #include "modules/background_sync/SyncEvent.h"
|
| #include "modules/fetch/Headers.h"
|
| #include "modules/notifications/Notification.h"
|
| @@ -145,6 +149,48 @@ void ServiceWorkerGlobalScopeProxy::dispatchBackgroundFetchClickEvent(
|
| workerGlobalScope()->dispatchExtendableEvent(event, observer);
|
| }
|
|
|
| +void ServiceWorkerGlobalScopeProxy::dispatchBackgroundFetchFailEvent(
|
| + int eventID,
|
| + const WebString& tag,
|
| + const WebVector<WebBackgroundFetchSettledFetch>& fetches) {
|
| + WaitUntilObserver* observer = WaitUntilObserver::create(
|
| + workerGlobalScope(), WaitUntilObserver::BackgroundFetchFail, eventID);
|
| +
|
| + BackgroundFetchFailEventInit init;
|
| + init.setTag(tag);
|
| +
|
| + ScriptState* scriptState =
|
| + workerGlobalScope()->scriptController()->getScriptState();
|
| + ScriptState::Scope scope(scriptState);
|
| +
|
| + BackgroundFetchFailEvent* event =
|
| + BackgroundFetchFailEvent::create(EventTypeNames::backgroundfetchfail,
|
| + init, fetches, scriptState, observer);
|
| +
|
| + workerGlobalScope()->dispatchExtendableEvent(event, observer);
|
| +}
|
| +
|
| +void ServiceWorkerGlobalScopeProxy::dispatchBackgroundFetchedEvent(
|
| + int eventID,
|
| + const WebString& tag,
|
| + const WebVector<WebBackgroundFetchSettledFetch>& fetches) {
|
| + WaitUntilObserver* observer = WaitUntilObserver::create(
|
| + workerGlobalScope(), WaitUntilObserver::BackgroundFetched, eventID);
|
| +
|
| + BackgroundFetchedEventInit init;
|
| + init.setTag(tag);
|
| +
|
| + ScriptState* scriptState =
|
| + workerGlobalScope()->scriptController()->getScriptState();
|
| + ScriptState::Scope scope(scriptState);
|
| +
|
| + BackgroundFetchedEvent* event = BackgroundFetchedEvent::create(
|
| + EventTypeNames::backgroundfetched, init, fetches, scriptState, observer,
|
| + m_workerGlobalScope->registration());
|
| +
|
| + workerGlobalScope()->dispatchExtendableEvent(event, observer);
|
| +}
|
| +
|
| void ServiceWorkerGlobalScopeProxy::dispatchActivateEvent(int eventID) {
|
| WaitUntilObserver* observer = WaitUntilObserver::create(
|
| workerGlobalScope(), WaitUntilObserver::Activate, eventID);
|
|
|