Index: Source/modules/serviceworkers/Client.cpp |
diff --git a/Source/modules/serviceworkers/Client.cpp b/Source/modules/serviceworkers/Client.cpp |
index 77890687d12702f277cc362f647c92579bbcdb0d..854fdbb5123e1ee2f6509dee3392b4d82e8a986e 100644 |
--- a/Source/modules/serviceworkers/Client.cpp |
+++ b/Source/modules/serviceworkers/Client.cpp |
@@ -5,6 +5,8 @@ |
#include "config.h" |
#include "modules/serviceworkers/Client.h" |
+#include "bindings/v8/ExceptionState.h" |
+#include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" |
#include "wtf/RefPtr.h" |
namespace WebCore { |
@@ -24,4 +26,14 @@ Client::~Client() |
{ |
} |
+void Client::postMessage(ExecutionContext* context, PassRefPtr<SerializedScriptValue> message, const MessagePortArray* ports, ExceptionState& exceptionState) |
+{ |
+ // Disentangle the port in preparation for sending it to the remote context. |
+ OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(ports, exceptionState); |
+ if (exceptionState.hadException()) |
+ return; |
+ |
+ ServiceWorkerGlobalScopeClient::from(context)->postMessageToClient(m_id, message, channels.release()); |
+} |
+ |
} // namespace WebCore |