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

Unified Diff: Source/web/ServiceWorkerGlobalScopeClientImpl.cpp

Issue 264233003: Add blink-side binding code and tests for ServiceWorker -> Document postMessage (3/3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: added message port tests Created 6 years, 7 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
« no previous file with comments | « Source/web/ServiceWorkerGlobalScopeClientImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/ServiceWorkerGlobalScopeClientImpl.cpp
diff --git a/Source/web/ServiceWorkerGlobalScopeClientImpl.cpp b/Source/web/ServiceWorkerGlobalScopeClientImpl.cpp
index fcb9a2e1b6d467632aa3c54543946ab36e67c40d..05c06feaa1967ab8bd38dae5a568ae9f3b1fb491 100644
--- a/Source/web/ServiceWorkerGlobalScopeClientImpl.cpp
+++ b/Source/web/ServiceWorkerGlobalScopeClientImpl.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "web/ServiceWorkerGlobalScopeClientImpl.h"
+#include "bindings/v8/SerializedScriptValue.h"
#include "modules/serviceworkers/Response.h"
#include "platform/NotImplemented.h"
#include "public/platform/WebServiceWorkerResponse.h"
@@ -88,6 +89,13 @@ void ServiceWorkerGlobalScopeClientImpl::didHandleSyncEvent(int syncEventID)
m_client.didHandleSyncEvent(syncEventID);
}
+void ServiceWorkerGlobalScopeClientImpl::postMessageToClient(int clientID, PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels)
+{
+ blink::WebString messageString = message->toWireString();
jsbell 2014/05/07 23:46:33 Just curious - is there a reason to defer the toWi
kinuko 2014/05/08 02:28:23 No strong reason, did so just to avoid some header
+ OwnPtr<blink::WebMessagePortChannelArray> webChannels = MessagePort::toWebMessagePortChannelArray(channels);
+ m_client.postMessageToClient(clientID, messageString, webChannels.leakPtr());
+}
+
ServiceWorkerGlobalScopeClientImpl::ServiceWorkerGlobalScopeClientImpl(WebServiceWorkerContextClient& client)
: m_client(client)
{
« no previous file with comments | « Source/web/ServiceWorkerGlobalScopeClientImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698