Chromium Code Reviews| 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 b3d1850adf7115988cb12ace8c85a4223eb20caa..24e3cdcfeb616100892169856f8edd1773ea2bb9 100644 |
| --- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp |
| +++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp |
| @@ -40,6 +40,7 @@ |
| #include "core/origin_trials/OriginTrials.h" |
| #include "core/workers/WorkerGlobalScope.h" |
| #include "core/workers/WorkerThread.h" |
| +#include "modules/background_sync/BackgroundSyncClientImpl.h" |
| #include "modules/background_sync/SyncEvent.h" |
|
jbroman
2016/11/21 21:36:01
The include of SyncEvent here can probably go away
|
| #include "modules/fetch/Headers.h" |
| #include "modules/notifications/Notification.h" |
| @@ -57,6 +58,7 @@ |
| #include "modules/serviceworkers/ServiceWorkerWindowClient.h" |
| #include "modules/serviceworkers/WaitUntilObserver.h" |
| #include "platform/RuntimeEnabledFeatures.h" |
| +#include "public/platform/InterfaceRegistry.h" |
| #include "public/platform/modules/notifications/WebNotificationData.h" |
| #include "public/platform/modules/serviceworker/WebServiceWorkerEventResult.h" |
| #include "public/platform/modules/serviceworker/WebServiceWorkerRequest.h" |
| @@ -309,23 +311,6 @@ void ServiceWorkerGlobalScopeProxy::dispatchPushEvent(int eventID, |
| workerGlobalScope()->dispatchExtendableEvent(event, observer); |
| } |
| -void ServiceWorkerGlobalScopeProxy::dispatchSyncEvent( |
| - int eventID, |
| - const WebString& tag, |
| - LastChanceOption lastChance) { |
| - if (!RuntimeEnabledFeatures::backgroundSyncEnabled()) { |
| - ServiceWorkerGlobalScopeClient::from(workerGlobalScope()) |
| - ->didHandleSyncEvent(eventID, WebServiceWorkerEventResultCompleted, |
| - WTF::currentTime()); |
| - return; |
| - } |
| - WaitUntilObserver* observer = WaitUntilObserver::create( |
| - workerGlobalScope(), WaitUntilObserver::Sync, eventID); |
| - Event* event = SyncEvent::create(EventTypeNames::sync, tag, |
| - lastChance == IsLastChance, observer); |
| - workerGlobalScope()->dispatchExtendableEvent(event, observer); |
| -} |
| - |
| bool ServiceWorkerGlobalScopeProxy::hasFetchEventHandler() { |
| DCHECK(m_workerGlobalScope); |
| return m_workerGlobalScope->hasEventListeners(EventTypeNames::fetch); |
| @@ -363,6 +348,8 @@ void ServiceWorkerGlobalScopeProxy::didCreateWorkerGlobalScope( |
| m_workerGlobalScope = |
| static_cast<ServiceWorkerGlobalScope*>(workerGlobalScope); |
| client().workerContextStarted(this); |
| + client().interfaceRegistry()->addInterface( |
| + WTF::bind(&BackgroundSyncClientImpl::Create, m_workerGlobalScope)); |
| } |
| void ServiceWorkerGlobalScopeProxy::didInitializeWorkerContext() { |