| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/serviceworkers/ServiceWorkerClient.h" | 5 #include "modules/serviceworkers/ServiceWorkerClient.h" |
| 6 #include "modules/serviceworkers/ServiceWorkerWindowClient.h" | 6 #include "modules/serviceworkers/ServiceWorkerWindowClient.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 8 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
| 9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
| 10 #include "bindings/core/v8/SerializedScriptValue.h" | 10 #include "bindings/core/v8/SerializedScriptValue.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 { | 71 { |
| 72 // Disentangle the port in preparation for sending it to the remote context. | 72 // Disentangle the port in preparation for sending it to the remote context. |
| 73 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(con
text, ports, exceptionState); | 73 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(con
text, ports, exceptionState); |
| 74 if (exceptionState.hadException()) | 74 if (exceptionState.hadException()) |
| 75 return; | 75 return; |
| 76 | 76 |
| 77 if (message->containsTransferableArrayBuffer()) | 77 if (message->containsTransferableArrayBuffer()) |
| 78 context->addConsoleMessage(ConsoleMessage::create(JSMessageSource, Warni
ngMessageLevel, "ServiceWorkerClient cannot send an ArrayBuffer as a transferabl
e object yet. See http://crbug.com/511119")); | 78 context->addConsoleMessage(ConsoleMessage::create(JSMessageSource, Warni
ngMessageLevel, "ServiceWorkerClient cannot send an ArrayBuffer as a transferabl
e object yet. See http://crbug.com/511119")); |
| 79 | 79 |
| 80 WebString messageString = message->toWireString(); | 80 WebString messageString = message->toWireString(); |
| 81 OwnPtr<WebMessagePortChannelArray> webChannels = MessagePort::toWebMessagePo
rtChannelArray(channels.release()); | 81 OwnPtr<WebMessagePortChannelArray> webChannels = MessagePort::toWebMessagePo
rtChannelArray(std::move(channels)); |
| 82 ServiceWorkerGlobalScopeClient::from(context)->postMessageToClient(m_uuid, m
essageString, webChannels.release()); | 82 ServiceWorkerGlobalScopeClient::from(context)->postMessageToClient(m_uuid, m
essageString, std::move(webChannels)); |
| 83 } | 83 } |
| 84 | 84 |
| 85 } // namespace blink | 85 } // namespace blink |
| OLD | NEW |