Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(537)

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp

Issue 2831943002: bindings: Port bindings/core/v8 away from ToImplArray APIs. (Closed)
Patch Set: Check for exception in SerializedScriptValue Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698