OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 12 matching lines...) Expand all Loading... |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "bindings/core/v8/V8MessageEvent.h" | 31 #include "bindings/core/v8/V8MessageEvent.h" |
32 | 32 |
| 33 #include "bindings/core/v8/IDLTypes.h" |
| 34 #include "bindings/core/v8/NativeValueTraitsImpl.h" |
33 #include "bindings/core/v8/SerializedScriptValue.h" | 35 #include "bindings/core/v8/SerializedScriptValue.h" |
34 #include "bindings/core/v8/SerializedScriptValueFactory.h" | 36 #include "bindings/core/v8/SerializedScriptValueFactory.h" |
35 #include "bindings/core/v8/V8ArrayBuffer.h" | 37 #include "bindings/core/v8/V8ArrayBuffer.h" |
36 #include "bindings/core/v8/V8Binding.h" | 38 #include "bindings/core/v8/V8Binding.h" |
37 #include "bindings/core/v8/V8Blob.h" | 39 #include "bindings/core/v8/V8Blob.h" |
38 #include "bindings/core/v8/V8EventTarget.h" | 40 #include "bindings/core/v8/V8EventTarget.h" |
39 #include "bindings/core/v8/V8MessagePort.h" | 41 #include "bindings/core/v8/V8MessagePort.h" |
40 #include "bindings/core/v8/V8PrivateProperty.h" | 42 #include "bindings/core/v8/V8PrivateProperty.h" |
41 #include "bindings/core/v8/V8Window.h" | 43 #include "bindings/core/v8/V8Window.h" |
42 | 44 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 return; | 114 return; |
113 v8::Local<v8::Value> data_arg = info[3]; | 115 v8::Local<v8::Value> data_arg = info[3]; |
114 TOSTRING_VOID(V8StringResource<>, origin_arg, info[4]); | 116 TOSTRING_VOID(V8StringResource<>, origin_arg, info[4]); |
115 TOSTRING_VOID(V8StringResource<>, last_event_id_arg, info[5]); | 117 TOSTRING_VOID(V8StringResource<>, last_event_id_arg, info[5]); |
116 EventTarget* source_arg = | 118 EventTarget* source_arg = |
117 V8EventTarget::toImplWithTypeCheck(info.GetIsolate(), info[6]); | 119 V8EventTarget::toImplWithTypeCheck(info.GetIsolate(), info[6]); |
118 MessagePortArray* port_array = nullptr; | 120 MessagePortArray* port_array = nullptr; |
119 const int kPortArrayIndex = 7; | 121 const int kPortArrayIndex = 7; |
120 if (!IsUndefinedOrNull(info[kPortArrayIndex])) { | 122 if (!IsUndefinedOrNull(info[kPortArrayIndex])) { |
121 port_array = new MessagePortArray; | 123 port_array = new MessagePortArray; |
122 *port_array = ToMemberNativeArray<MessagePort>( | 124 *port_array = NativeValueTraits<IDLSequence<MessagePort>>::NativeValue( |
123 info[kPortArrayIndex], kPortArrayIndex + 1, info.GetIsolate(), | 125 info.GetIsolate(), info[kPortArrayIndex], exception_state); |
124 exception_state); | |
125 if (exception_state.HadException()) | 126 if (exception_state.HadException()) |
126 return; | 127 return; |
127 } | 128 } |
128 event->initMessageEvent( | 129 event->initMessageEvent( |
129 type_arg, can_bubble_arg, cancelable_arg, | 130 type_arg, can_bubble_arg, cancelable_arg, |
130 ScriptValue(ScriptState::Current(info.GetIsolate()), data_arg), | 131 ScriptValue(ScriptState::Current(info.GetIsolate()), data_arg), |
131 origin_arg, last_event_id_arg, source_arg, port_array); | 132 origin_arg, last_event_id_arg, source_arg, port_array); |
132 } | 133 } |
133 | 134 |
134 } // namespace blink | 135 } // namespace blink |
OLD | NEW |