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

Unified Diff: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 2517223002: Move content/renderer/background_sync to Blink (Closed)
Patch Set: Fix broken WebEmbeddedWorker test Created 4 years, 1 month 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
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"
#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() {

Powered by Google App Engine
This is Rietveld 408576698