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 #ifndef PostMessage_h | 5 #ifndef PostMessage_h |
6 #define PostMessage_h | 6 #define PostMessage_h |
7 | 7 |
8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
9 #include "bindings/core/v8/SerializedScriptValue.h" | 9 #include "bindings/core/v8/SerializedScriptValue.h" |
10 #include "bindings/core/v8/SerializedScriptValueFactory.h" | 10 #include "bindings/core/v8/SerializedScriptValueFactory.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 MessagePortArray ports; | 31 MessagePortArray ports; |
32 ArrayBufferArray arrayBuffers; | 32 ArrayBufferArray arrayBuffers; |
33 if (info.Length() > 1) { | 33 if (info.Length() > 1) { |
34 const int transferablesArgIndex = 1; | 34 const int transferablesArgIndex = 1; |
35 if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info
[transferablesArgIndex], transferablesArgIndex, ports, arrayBuffers, exceptionSt
ate)) { | 35 if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info
[transferablesArgIndex], transferablesArgIndex, ports, arrayBuffers, exceptionSt
ate)) { |
36 exceptionState.throwIfNeeded(); | 36 exceptionState.throwIfNeeded(); |
37 return; | 37 return; |
38 } | 38 } |
39 } | 39 } |
40 RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instan
ce().create(info[0], &ports, &arrayBuffers, exceptionState, info.GetIsolate()); | 40 RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instan
ce().create(info.GetIsolate(), info[0], &ports, &arrayBuffers, exceptionState); |
41 if (exceptionState.throwIfNeeded()) | 41 if (exceptionState.throwIfNeeded()) |
42 return; | 42 return; |
43 // FIXME: Only pass context/exceptionState if instance really requires it. | 43 // FIXME: Only pass context/exceptionState if instance really requires it. |
44 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); | 44 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); |
45 instance->postMessage(context, message.release(), &ports, exceptionState); | 45 instance->postMessage(context, message.release(), &ports, exceptionState); |
46 exceptionState.throwIfNeeded(); | 46 exceptionState.throwIfNeeded(); |
47 } | 47 } |
48 | 48 |
49 } // namespace blink | 49 } // namespace blink |
50 | 50 |
51 #endif // PostMessage_h | 51 #endif // PostMessage_h |
OLD | NEW |