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 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
6 | 6 |
7 #include "V8TestInterfaceConstructor.h" | 7 #include "V8TestInterfaceConstructor.h" |
8 | 8 |
9 #include "bindings/core/v8/Dictionary.h" | 9 #include "bindings/core/v8/Dictionary.h" |
10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eConstructor.h. | 35 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eConstructor.h. |
36 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | 36 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
37 // bindings/core/v8/ScriptWrappable.h. | 37 // bindings/core/v8/ScriptWrappable.h. |
38 const WrapperTypeInfo& TestInterfaceConstructor::s_wrapperTypeInfo = V8TestInter
faceConstructor::wrapperTypeInfo; | 38 const WrapperTypeInfo& TestInterfaceConstructor::s_wrapperTypeInfo = V8TestInter
faceConstructor::wrapperTypeInfo; |
39 | 39 |
40 namespace TestInterfaceConstructorV8Internal { | 40 namespace TestInterfaceConstructorV8Internal { |
41 | 41 |
42 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) | 42 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) |
43 { | 43 { |
44 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), info.GetIsolate()); | 44 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), info.GetIsolate()); |
45 ScriptState* scriptState = ScriptState::forHolderObject(info); | 45 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
46 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | 46 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); |
47 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; | 47 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; |
48 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptStat
e, executionContext, document, exceptionState); | 48 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptStat
e, executionContext, document, exceptionState); |
49 if (exceptionState.hadException()) { | 49 if (exceptionState.hadException()) { |
50 exceptionState.throwIfNeeded(); | 50 exceptionState.throwIfNeeded(); |
51 return; | 51 return; |
52 } | 52 } |
53 v8::Local<v8::Object> wrapper = info.Holder(); | 53 v8::Local<v8::Object> wrapper = info.Holder(); |
54 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor::wrapperTypeInfo, wrapper); | 54 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor::wrapperTypeInfo, wrapper); |
55 v8SetReturnValue(info, wrapper); | 55 v8SetReturnValue(info, wrapper); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 optionalDictionaryArg = Dictionary(info[7], info.GetIsolate(), exception
State); | 105 optionalDictionaryArg = Dictionary(info[7], info.GetIsolate(), exception
State); |
106 if (exceptionState.throwIfNeeded()) | 106 if (exceptionState.throwIfNeeded()) |
107 return; | 107 return; |
108 optionalTestInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeChec
k(info.GetIsolate(), info[8]); | 108 optionalTestInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeChec
k(info.GetIsolate(), info[8]); |
109 if (!optionalTestInterfaceEmptyArg) { | 109 if (!optionalTestInterfaceEmptyArg) { |
110 exceptionState.throwTypeError("parameter 9 is not of type 'TestInter
faceEmpty'."); | 110 exceptionState.throwTypeError("parameter 9 is not of type 'TestInter
faceEmpty'."); |
111 exceptionState.throwIfNeeded(); | 111 exceptionState.throwIfNeeded(); |
112 return; | 112 return; |
113 } | 113 } |
114 } | 114 } |
115 ScriptState* scriptState = ScriptState::forHolderObject(info); | 115 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
116 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | 116 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); |
117 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; | 117 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; |
118 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptStat
e, executionContext, document, doubleArg, stringArg, testInterfaceEmptyArg, dict
ionaryArg, sequenceStringArg, sequenceDictionaryArg, sequenceLongOrTestDictionar
yArg, optionalDictionaryArg, optionalTestInterfaceEmptyArg, exceptionState); | 118 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptStat
e, executionContext, document, doubleArg, stringArg, testInterfaceEmptyArg, dict
ionaryArg, sequenceStringArg, sequenceDictionaryArg, sequenceLongOrTestDictionar
yArg, optionalDictionaryArg, optionalTestInterfaceEmptyArg, exceptionState); |
119 if (exceptionState.hadException()) { | 119 if (exceptionState.hadException()) { |
120 exceptionState.throwIfNeeded(); | 120 exceptionState.throwIfNeeded(); |
121 return; | 121 return; |
122 } | 122 } |
123 v8::Local<v8::Object> wrapper = info.Holder(); | 123 v8::Local<v8::Object> wrapper = info.Holder(); |
124 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor::wrapperTypeInfo, wrapper); | 124 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor::wrapperTypeInfo, wrapper); |
125 v8SetReturnValue(info, wrapper); | 125 v8SetReturnValue(info, wrapper); |
126 } | 126 } |
127 | 127 |
128 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) | 128 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) |
129 { | 129 { |
130 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), info.GetIsolate()); | 130 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), info.GetIsolate()); |
131 V8StringResource<> arg; | 131 V8StringResource<> arg; |
132 V8StringResource<> optArg; | 132 V8StringResource<> optArg; |
133 { | 133 { |
134 int numArgsPassed = info.Length(); | 134 int numArgsPassed = info.Length(); |
135 while (numArgsPassed > 0) { | 135 while (numArgsPassed > 0) { |
136 if (!info[numArgsPassed - 1]->IsUndefined()) | 136 if (!info[numArgsPassed - 1]->IsUndefined()) |
137 break; | 137 break; |
138 --numArgsPassed; | 138 --numArgsPassed; |
139 } | 139 } |
140 arg = info[0]; | 140 arg = info[0]; |
141 if (!arg.prepare()) | 141 if (!arg.prepare()) |
142 return; | 142 return; |
143 if (UNLIKELY(numArgsPassed <= 1)) { | 143 if (UNLIKELY(numArgsPassed <= 1)) { |
144 ScriptState* scriptState = ScriptState::forHolderObject(info); | 144 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
145 ExecutionContext* executionContext = currentExecutionContext(info.Ge
tIsolate()); | 145 ExecutionContext* executionContext = currentExecutionContext(info.Ge
tIsolate()); |
146 Document& document = *toDocument(currentExecutionContext(info.GetIso
late())); | 146 Document& document = *toDocument(currentExecutionContext(info.GetIso
late())); |
147 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(sc
riptState, executionContext, document, arg, exceptionState); | 147 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(sc
riptState, executionContext, document, arg, exceptionState); |
148 if (exceptionState.hadException()) { | 148 if (exceptionState.hadException()) { |
149 exceptionState.throwIfNeeded(); | 149 exceptionState.throwIfNeeded(); |
150 return; | 150 return; |
151 } | 151 } |
152 v8::Local<v8::Object> wrapper = info.Holder(); | 152 v8::Local<v8::Object> wrapper = info.Holder(); |
153 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInter
faceConstructor::wrapperTypeInfo, wrapper); | 153 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInter
faceConstructor::wrapperTypeInfo, wrapper); |
154 v8SetReturnValue(info, wrapper); | 154 v8SetReturnValue(info, wrapper); |
155 return; | 155 return; |
156 } | 156 } |
157 optArg = info[1]; | 157 optArg = info[1]; |
158 if (!optArg.prepare()) | 158 if (!optArg.prepare()) |
159 return; | 159 return; |
160 } | 160 } |
161 ScriptState* scriptState = ScriptState::forHolderObject(info); | 161 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
162 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | 162 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); |
163 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; | 163 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; |
164 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptStat
e, executionContext, document, arg, optArg, exceptionState); | 164 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptStat
e, executionContext, document, arg, optArg, exceptionState); |
165 if (exceptionState.hadException()) { | 165 if (exceptionState.hadException()) { |
166 exceptionState.throwIfNeeded(); | 166 exceptionState.throwIfNeeded(); |
167 return; | 167 return; |
168 } | 168 } |
169 v8::Local<v8::Object> wrapper = info.Holder(); | 169 v8::Local<v8::Object> wrapper = info.Holder(); |
170 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor::wrapperTypeInfo, wrapper); | 170 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor::wrapperTypeInfo, wrapper); |
171 v8SetReturnValue(info, wrapper); | 171 v8SetReturnValue(info, wrapper); |
172 } | 172 } |
173 | 173 |
174 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info) | 174 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info) |
175 { | 175 { |
176 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), info.GetIsolate()); | 176 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), info.GetIsolate()); |
177 V8StringResource<> arg; | 177 V8StringResource<> arg; |
178 V8StringResource<> arg2; | 178 V8StringResource<> arg2; |
179 V8StringResource<> arg3; | 179 V8StringResource<> arg3; |
180 { | 180 { |
181 arg = info[0]; | 181 arg = info[0]; |
182 if (!arg.prepare()) | 182 if (!arg.prepare()) |
183 return; | 183 return; |
184 arg2 = info[1]; | 184 arg2 = info[1]; |
185 if (!arg2.prepare()) | 185 if (!arg2.prepare()) |
186 return; | 186 return; |
187 arg3 = info[2]; | 187 arg3 = info[2]; |
188 if (!arg3.prepare()) | 188 if (!arg3.prepare()) |
189 return; | 189 return; |
190 } | 190 } |
191 ScriptState* scriptState = ScriptState::forHolderObject(info); | 191 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
192 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | 192 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); |
193 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; | 193 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; |
194 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptStat
e, executionContext, document, arg, arg2, arg3, exceptionState); | 194 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptStat
e, executionContext, document, arg, arg2, arg3, exceptionState); |
195 if (exceptionState.hadException()) { | 195 if (exceptionState.hadException()) { |
196 exceptionState.throwIfNeeded(); | 196 exceptionState.throwIfNeeded(); |
197 return; | 197 return; |
198 } | 198 } |
199 v8::Local<v8::Object> wrapper = info.Holder(); | 199 v8::Local<v8::Object> wrapper = info.Holder(); |
200 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor::wrapperTypeInfo, wrapper); | 200 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor::wrapperTypeInfo, wrapper); |
201 v8SetReturnValue(info, wrapper); | 201 v8SetReturnValue(info, wrapper); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 int numArgsPassed = info.Length(); | 297 int numArgsPassed = info.Length(); |
298 while (numArgsPassed > 0) { | 298 while (numArgsPassed > 0) { |
299 if (!info[numArgsPassed - 1]->IsUndefined()) | 299 if (!info[numArgsPassed - 1]->IsUndefined()) |
300 break; | 300 break; |
301 --numArgsPassed; | 301 --numArgsPassed; |
302 } | 302 } |
303 arg = info[0]; | 303 arg = info[0]; |
304 if (!arg.prepare()) | 304 if (!arg.prepare()) |
305 return; | 305 return; |
306 if (UNLIKELY(numArgsPassed <= 1)) { | 306 if (UNLIKELY(numArgsPassed <= 1)) { |
307 ScriptState* scriptState = ScriptState::forHolderObject(info); | 307 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
308 ExecutionContext* executionContext = currentExecutionContext(info.Ge
tIsolate()); | 308 ExecutionContext* executionContext = currentExecutionContext(info.Ge
tIsolate()); |
309 Document& document = *toDocument(currentExecutionContext(info.GetIso
late())); | 309 Document& document = *toDocument(currentExecutionContext(info.GetIso
late())); |
310 TestInterfaceConstructor* impl = TestInterfaceConstructor::createFor
JSConstructor(scriptState, executionContext, document, arg, exceptionState); | 310 TestInterfaceConstructor* impl = TestInterfaceConstructor::createFor
JSConstructor(scriptState, executionContext, document, arg, exceptionState); |
311 if (exceptionState.hadException()) { | 311 if (exceptionState.hadException()) { |
312 exceptionState.throwIfNeeded(); | 312 exceptionState.throwIfNeeded(); |
313 return; | 313 return; |
314 } | 314 } |
315 v8::Local<v8::Object> wrapper = info.Holder(); | 315 v8::Local<v8::Object> wrapper = info.Holder(); |
316 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInter
faceConstructorConstructor::wrapperTypeInfo, wrapper); | 316 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInter
faceConstructorConstructor::wrapperTypeInfo, wrapper); |
317 v8SetReturnValue(info, wrapper); | 317 v8SetReturnValue(info, wrapper); |
318 return; | 318 return; |
319 } | 319 } |
320 optArg = info[1]; | 320 optArg = info[1]; |
321 if (!optArg.prepare()) | 321 if (!optArg.prepare()) |
322 return; | 322 return; |
323 } | 323 } |
324 ScriptState* scriptState = ScriptState::forHolderObject(info); | 324 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
325 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | 325 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); |
326 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; | 326 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; |
327 TestInterfaceConstructor* impl = TestInterfaceConstructor::createForJSConstr
uctor(scriptState, executionContext, document, arg, optArg, exceptionState); | 327 TestInterfaceConstructor* impl = TestInterfaceConstructor::createForJSConstr
uctor(scriptState, executionContext, document, arg, optArg, exceptionState); |
328 if (exceptionState.hadException()) { | 328 if (exceptionState.hadException()) { |
329 exceptionState.throwIfNeeded(); | 329 exceptionState.throwIfNeeded(); |
330 return; | 330 return; |
331 } | 331 } |
332 v8::Local<v8::Object> wrapper = info.Holder(); | 332 v8::Local<v8::Object> wrapper = info.Holder(); |
333 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructorConstructor::wrapperTypeInfo, wrapper); | 333 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructorConstructor::wrapperTypeInfo, wrapper); |
334 v8SetReturnValue(info, wrapper); | 334 v8SetReturnValue(info, wrapper); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 { | 397 { |
398 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 398 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
399 } | 399 } |
400 | 400 |
401 TestInterfaceConstructor* V8TestInterfaceConstructor::toImplWithTypeCheck(v8::Is
olate* isolate, v8::Local<v8::Value> value) | 401 TestInterfaceConstructor* V8TestInterfaceConstructor::toImplWithTypeCheck(v8::Is
olate* isolate, v8::Local<v8::Value> value) |
402 { | 402 { |
403 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; | 403 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; |
404 } | 404 } |
405 | 405 |
406 } // namespace blink | 406 } // namespace blink |
OLD | NEW |