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

Unified Diff: Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 1210633002: Update navigator.services API to use the new services.onconnect event [1/3]. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@serviceport-part3
Patch Set: rebase Created 5 years, 5 months 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: Source/web/ServiceWorkerGlobalScopeProxy.cpp
diff --git a/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/Source/web/ServiceWorkerGlobalScopeProxy.cpp
index 7ab8240af62fe62bd3a66fe851006eb3fb400127..7cb8df288637c5a1e4b5ea90771207ae916b959a 100644
--- a/Source/web/ServiceWorkerGlobalScopeProxy.cpp
+++ b/Source/web/ServiceWorkerGlobalScopeProxy.cpp
@@ -46,6 +46,8 @@
#include "modules/navigatorconnect/AcceptConnectionObserver.h"
#include "modules/navigatorconnect/CrossOriginConnectEvent.h"
#include "modules/navigatorconnect/CrossOriginServiceWorkerClient.h"
+#include "modules/navigatorconnect/ServicePortCollection.h"
+#include "modules/navigatorconnect/WorkerNavigatorServices.h"
#include "modules/notifications/Notification.h"
#include "modules/notifications/NotificationEvent.h"
#include "modules/push_messaging/PushEvent.h"
@@ -150,6 +152,14 @@ void ServiceWorkerGlobalScopeProxy::dispatchPushEvent(int eventID, const WebStri
m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer);
}
+void ServiceWorkerGlobalScopeProxy::dispatchServicePortConnectEvent(WebServicePortConnectEventCallbacks* rawCallbacks, const WebURL& targetURL, const WebString& origin, WebServicePortID portID)
+{
+ ASSERT(m_workerGlobalScope);
+ OwnPtr<WebServicePortConnectEventCallbacks> callbacks = adoptPtr(rawCallbacks);
+ ServicePortCollection* collection = WorkerNavigatorServices::services(m_workerGlobalScope, *m_workerGlobalScope->navigator());
+ collection->dispatchConnectEvent(callbacks.release(), targetURL, origin, portID);
+}
+
void ServiceWorkerGlobalScopeProxy::dispatchSyncEvent(int eventID)
{
ASSERT(m_workerGlobalScope);
« no previous file with comments | « Source/web/ServiceWorkerGlobalScopeProxy.h ('k') | public/platform/modules/navigator_services/WebServicePortCallbacks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698