| Index: Source/web/ServiceWorkerGlobalScopeProxy.cpp
|
| diff --git a/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/Source/web/ServiceWorkerGlobalScopeProxy.cpp
|
| index 45e2d0aef78196b72fc78abc671f9b2949ba0714..3dadbdd657326bdac23ab81a33512883cd7c184d 100644
|
| --- a/Source/web/ServiceWorkerGlobalScopeProxy.cpp
|
| +++ b/Source/web/ServiceWorkerGlobalScopeProxy.cpp
|
| @@ -39,6 +39,7 @@
|
| #include "core/events/MessageEvent.h"
|
| #include "core/inspector/ConsoleMessage.h"
|
| #include "core/workers/WorkerGlobalScope.h"
|
| +#include "modules/background_sync/SyncEvent.h"
|
| #include "modules/fetch/Headers.h"
|
| #include "modules/geofencing/CircularGeofencingRegion.h"
|
| #include "modules/geofencing/GeofencingEvent.h"
|
| @@ -163,9 +164,14 @@ void ServiceWorkerGlobalScopeProxy::dispatchPushEvent(int eventID, const WebStri
|
| void ServiceWorkerGlobalScopeProxy::dispatchSyncEvent(int eventID)
|
| {
|
| ASSERT(m_workerGlobalScope);
|
| - if (RuntimeEnabledFeatures::backgroundSyncEnabled())
|
| - m_workerGlobalScope->dispatchEvent(Event::create(EventTypeNames::sync));
|
| - ServiceWorkerGlobalScopeClient::from(m_workerGlobalScope)->didHandleSyncEvent(eventID);
|
| + if (!RuntimeEnabledFeatures::backgroundSyncEnabled()) {
|
| + ServiceWorkerGlobalScopeClient::from(m_workerGlobalScope)->didHandleSyncEvent(eventID, WebServiceWorkerEventResultCompleted);
|
| + return;
|
| + }
|
| + WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::Sync, eventID);
|
| + // TODO(chasej) - Send registration as in crbug.com/482066
|
| + RefPtrWillBeRawPtr<Event> event(SyncEvent::create(EventTypeNames::sync, nullptr /* registration */, observer));
|
| + m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer);
|
| }
|
|
|
| void ServiceWorkerGlobalScopeProxy::dispatchCrossOriginConnectEvent(int eventID, const WebCrossOriginServiceWorkerClient& webClient)
|
|
|