Chromium Code Reviews| 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) |
| { |