OLD | NEW |
1 /* | 1 /* |
2 This file is part of the Blink open source project. | 2 This file is part of the Blink open source project. |
3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! | 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! |
4 | 4 |
5 This library is free software; you can redistribute it and/or | 5 This library is free software; you can redistribute it and/or |
6 modify it under the terms of the GNU Library General Public | 6 modify it under the terms of the GNU Library General Public |
7 License as published by the Free Software Foundation; either | 7 License as published by the Free Software Foundation; either |
8 version 2 of the License, or (at your option) any later version. | 8 version 2 of the License, or (at your option) any later version. |
9 | 9 |
10 This library is distributed in the hope that it will be useful, | 10 This library is distributed in the hope that it will be useful, |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 Library General Public License for more details. | 13 Library General Public License for more details. |
14 | 14 |
15 You should have received a copy of the GNU Library General Public License | 15 You should have received a copy of the GNU Library General Public License |
16 along with this library; see the file COPYING.LIB. If not, write to | 16 along with this library; see the file COPYING.LIB. If not, write to |
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 Boston, MA 02111-1307, USA. | 18 Boston, MA 02111-1307, USA. |
19 */ | 19 */ |
20 | 20 |
21 #include "config.h" | 21 #include "config.h" |
22 #include "V8TestTypedefs.h" | 22 #include "V8TestTypedefs.h" |
23 | 23 |
24 #include "RuntimeEnabledFeatures.h" | 24 #include "RuntimeEnabledFeatures.h" |
25 #include "SerializedScriptValue.h" | 25 #include "SerializedScriptValue.h" |
26 #include "V8SVGPoint.h" | 26 #include "V8SVGPoint.h" |
27 #include "V8SerializedScriptValue.h" | 27 #include "V8SerializedScriptValue.h" |
28 #include "V8TestCallback.h" | 28 #include "V8TestCallback.h" |
29 #include "V8TestSubObj.h" | 29 #include "V8TestSubObj.h" |
| 30 #include "bindings/v8/ExceptionState.h" |
30 #include "bindings/v8/ScriptController.h" | 31 #include "bindings/v8/ScriptController.h" |
31 #include "bindings/v8/SerializedScriptValue.h" | 32 #include "bindings/v8/SerializedScriptValue.h" |
32 #include "bindings/v8/V8Binding.h" | 33 #include "bindings/v8/V8Binding.h" |
33 #include "bindings/v8/V8DOMConfiguration.h" | 34 #include "bindings/v8/V8DOMConfiguration.h" |
34 #include "bindings/v8/V8DOMWrapper.h" | 35 #include "bindings/v8/V8DOMWrapper.h" |
35 #include "bindings/v8/V8ObjectConstructor.h" | 36 #include "bindings/v8/V8ObjectConstructor.h" |
36 #include "core/dom/ContextFeatures.h" | 37 #include "core/dom/ContextFeatures.h" |
37 #include "core/dom/Document.h" | 38 #include "core/dom/Document.h" |
38 #include "core/dom/ExceptionCode.h" | |
39 #include "core/page/Frame.h" | 39 #include "core/page/Frame.h" |
40 #include "core/platform/chromium/TraceEvent.h" | 40 #include "core/platform/chromium/TraceEvent.h" |
41 #include "core/svg/properties/SVGPropertyTearOff.h" | 41 #include "core/svg/properties/SVGPropertyTearOff.h" |
42 #include "wtf/UnusedParam.h" | 42 #include "wtf/UnusedParam.h" |
43 | 43 |
44 namespace WebCore { | 44 namespace WebCore { |
45 | 45 |
46 static void initializeScriptWrappableForInterface(TestTypedefs* object) | 46 static void initializeScriptWrappableForInterface(TestTypedefs* object) |
47 { | 47 { |
48 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 48 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 static void immutableSerializedScriptValueAttrSetterCallback(v8::Local<v8::Strin
g> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) | 123 static void immutableSerializedScriptValueAttrSetterCallback(v8::Local<v8::Strin
g> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) |
124 { | 124 { |
125 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 125 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
126 TestTypedefsV8Internal::immutableSerializedScriptValueAttrSetter(name, value
, info); | 126 TestTypedefsV8Internal::immutableSerializedScriptValueAttrSetter(name, value
, info); |
127 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 127 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
128 } | 128 } |
129 | 129 |
130 static void attrWithGetterExceptionAttrGetter(v8::Local<v8::String> name, const
v8::PropertyCallbackInfo<v8::Value>& info) | 130 static void attrWithGetterExceptionAttrGetter(v8::Local<v8::String> name, const
v8::PropertyCallbackInfo<v8::Value>& info) |
131 { | 131 { |
132 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); | 132 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); |
133 ExceptionCode ec = 0; | 133 ExceptionState es(info.GetIsolate()); |
134 int v = imp->attrWithGetterException(ec); | 134 int v = imp->attrWithGetterException(es); |
135 if (UNLIKELY(ec)) { | 135 if (UNLIKELY(es.throwIfNeeded())) |
136 setDOMException(ec, info.GetIsolate()); | |
137 return; | 136 return; |
138 }; | |
139 v8SetReturnValueInt(info, v); | 137 v8SetReturnValueInt(info, v); |
140 return; | 138 return; |
141 } | 139 } |
142 | 140 |
143 static void attrWithGetterExceptionAttrGetterCallback(v8::Local<v8::String> name
, const v8::PropertyCallbackInfo<v8::Value>& info) | 141 static void attrWithGetterExceptionAttrGetterCallback(v8::Local<v8::String> name
, const v8::PropertyCallbackInfo<v8::Value>& info) |
144 { | 142 { |
145 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 143 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
146 TestTypedefsV8Internal::attrWithGetterExceptionAttrGetter(name, info); | 144 TestTypedefsV8Internal::attrWithGetterExceptionAttrGetter(name, info); |
147 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 145 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
148 } | 146 } |
(...skipping 24 matching lines...) Expand all Loading... |
173 { | 171 { |
174 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 172 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
175 TestTypedefsV8Internal::attrWithSetterExceptionAttrGetter(name, info); | 173 TestTypedefsV8Internal::attrWithSetterExceptionAttrGetter(name, info); |
176 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 174 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
177 } | 175 } |
178 | 176 |
179 static void attrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Lo
cal<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) | 177 static void attrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Lo
cal<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) |
180 { | 178 { |
181 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); | 179 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); |
182 V8TRYCATCH_VOID(int, v, toInt32(value)); | 180 V8TRYCATCH_VOID(int, v, toInt32(value)); |
183 ExceptionCode ec = 0; | 181 ExceptionState es(info.GetIsolate()); |
184 imp->setAttrWithSetterException(v, ec); | 182 imp->setAttrWithSetterException(v, es); |
185 if (UNLIKELY(ec)) | 183 es.throwIfNeeded(); |
186 setDOMException(ec, info.GetIsolate()); | |
187 return; | 184 return; |
188 } | 185 } |
189 | 186 |
190 static void attrWithSetterExceptionAttrSetterCallback(v8::Local<v8::String> name
, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) | 187 static void attrWithSetterExceptionAttrSetterCallback(v8::Local<v8::String> name
, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) |
191 { | 188 { |
192 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 189 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
193 TestTypedefsV8Internal::attrWithSetterExceptionAttrSetter(name, value, info)
; | 190 TestTypedefsV8Internal::attrWithSetterExceptionAttrSetter(name, value, info)
; |
194 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 191 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
195 } | 192 } |
196 | 193 |
197 static void stringAttrWithGetterExceptionAttrGetter(v8::Local<v8::String> name,
const v8::PropertyCallbackInfo<v8::Value>& info) | 194 static void stringAttrWithGetterExceptionAttrGetter(v8::Local<v8::String> name,
const v8::PropertyCallbackInfo<v8::Value>& info) |
198 { | 195 { |
199 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); | 196 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); |
200 ExceptionCode ec = 0; | 197 ExceptionState es(info.GetIsolate()); |
201 String v = imp->stringAttrWithGetterException(ec); | 198 String v = imp->stringAttrWithGetterException(es); |
202 if (UNLIKELY(ec)) { | 199 if (UNLIKELY(es.throwIfNeeded())) |
203 setDOMException(ec, info.GetIsolate()); | |
204 return; | 200 return; |
205 }; | |
206 v8SetReturnValueString(info, v, info.GetIsolate(), NullStringAsEmpty); | 201 v8SetReturnValueString(info, v, info.GetIsolate(), NullStringAsEmpty); |
207 return; | 202 return; |
208 } | 203 } |
209 | 204 |
210 static void stringAttrWithGetterExceptionAttrGetterCallback(v8::Local<v8::String
> name, const v8::PropertyCallbackInfo<v8::Value>& info) | 205 static void stringAttrWithGetterExceptionAttrGetterCallback(v8::Local<v8::String
> name, const v8::PropertyCallbackInfo<v8::Value>& info) |
211 { | 206 { |
212 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 207 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
213 TestTypedefsV8Internal::stringAttrWithGetterExceptionAttrGetter(name, info); | 208 TestTypedefsV8Internal::stringAttrWithGetterExceptionAttrGetter(name, info); |
214 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 209 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
215 } | 210 } |
(...skipping 24 matching lines...) Expand all Loading... |
240 { | 235 { |
241 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 236 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
242 TestTypedefsV8Internal::stringAttrWithSetterExceptionAttrGetter(name, info); | 237 TestTypedefsV8Internal::stringAttrWithSetterExceptionAttrGetter(name, info); |
243 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 238 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
244 } | 239 } |
245 | 240 |
246 static void stringAttrWithSetterExceptionAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) | 241 static void stringAttrWithSetterExceptionAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) |
247 { | 242 { |
248 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); | 243 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); |
249 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value); | 244 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value); |
250 ExceptionCode ec = 0; | 245 ExceptionState es(info.GetIsolate()); |
251 imp->setStringAttrWithSetterException(v, ec); | 246 imp->setStringAttrWithSetterException(v, es); |
252 if (UNLIKELY(ec)) | 247 es.throwIfNeeded(); |
253 setDOMException(ec, info.GetIsolate()); | |
254 return; | 248 return; |
255 } | 249 } |
256 | 250 |
257 static void stringAttrWithSetterExceptionAttrSetterCallback(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) | 251 static void stringAttrWithSetterExceptionAttrSetterCallback(v8::Local<v8::String
> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) |
258 { | 252 { |
259 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 253 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
260 TestTypedefsV8Internal::stringAttrWithSetterExceptionAttrSetter(name, value,
info); | 254 TestTypedefsV8Internal::stringAttrWithSetterExceptionAttrSetter(name, value,
info); |
261 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 255 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
262 } | 256 } |
263 | 257 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 414 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
421 } | 415 } |
422 | 416 |
423 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>&
args) | 417 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>&
args) |
424 { | 418 { |
425 if (args.Length() < 1) { | 419 if (args.Length() < 1) { |
426 throwNotEnoughArgumentsError(args.GetIsolate()); | 420 throwNotEnoughArgumentsError(args.GetIsolate()); |
427 return; | 421 return; |
428 } | 422 } |
429 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); | 423 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); |
430 ExceptionCode ec = 0; | 424 ExceptionState es(args.GetIsolate()); |
431 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(args[0])); | 425 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(args[0])); |
432 Vector<String> result = imp->stringArrayFunction(values, ec); | 426 Vector<String> result = imp->stringArrayFunction(values, es); |
433 if (UNLIKELY(ec)) { | 427 if (es.throwIfNeeded()) |
434 setDOMException(ec, args.GetIsolate()); | |
435 return; | 428 return; |
436 } | |
437 v8SetReturnValue(args, v8Array(result, args.GetIsolate())); | 429 v8SetReturnValue(args, v8Array(result, args.GetIsolate())); |
438 return; | 430 return; |
439 } | 431 } |
440 | 432 |
441 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& args) | 433 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& args) |
442 { | 434 { |
443 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 435 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
444 TestTypedefsV8Internal::stringArrayFunctionMethod(args); | 436 TestTypedefsV8Internal::stringArrayFunctionMethod(args); |
445 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 437 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
446 } | 438 } |
447 | 439 |
448 static void stringArrayFunction2Method(const v8::FunctionCallbackInfo<v8::Value>
& args) | 440 static void stringArrayFunction2Method(const v8::FunctionCallbackInfo<v8::Value>
& args) |
449 { | 441 { |
450 if (args.Length() < 1) { | 442 if (args.Length() < 1) { |
451 throwNotEnoughArgumentsError(args.GetIsolate()); | 443 throwNotEnoughArgumentsError(args.GetIsolate()); |
452 return; | 444 return; |
453 } | 445 } |
454 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); | 446 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); |
455 ExceptionCode ec = 0; | 447 ExceptionState es(args.GetIsolate()); |
456 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(args[0])); | 448 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(args[0])); |
457 Vector<String> result = imp->stringArrayFunction2(values, ec); | 449 Vector<String> result = imp->stringArrayFunction2(values, es); |
458 if (UNLIKELY(ec)) { | 450 if (es.throwIfNeeded()) |
459 setDOMException(ec, args.GetIsolate()); | |
460 return; | 451 return; |
461 } | |
462 v8SetReturnValue(args, v8Array(result, args.GetIsolate())); | 452 v8SetReturnValue(args, v8Array(result, args.GetIsolate())); |
463 return; | 453 return; |
464 } | 454 } |
465 | 455 |
466 static void stringArrayFunction2MethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& args) | 456 static void stringArrayFunction2MethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& args) |
467 { | 457 { |
468 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 458 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
469 TestTypedefsV8Internal::stringArrayFunction2Method(args); | 459 TestTypedefsV8Internal::stringArrayFunction2Method(args); |
470 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 460 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
471 } | 461 } |
472 | 462 |
473 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>&
args) | 463 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>&
args) |
474 { | 464 { |
475 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); | 465 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); |
476 ExceptionCode ec = 0; | 466 ExceptionState es(args.GetIsolate()); |
477 imp->methodWithException(ec); | 467 imp->methodWithException(es); |
478 if (UNLIKELY(ec)) { | 468 if (es.throwIfNeeded()) |
479 setDOMException(ec, args.GetIsolate()); | |
480 return; | 469 return; |
481 } | |
482 | 470 |
483 return; | 471 return; |
484 } | 472 } |
485 | 473 |
486 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& args) | 474 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& args) |
487 { | 475 { |
488 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 476 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
489 TestTypedefsV8Internal::methodWithExceptionMethod(args); | 477 TestTypedefsV8Internal::methodWithExceptionMethod(args); |
490 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 478 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
491 } | 479 } |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 installPerContextProperties(wrapper, impl.get(), isolate); | 605 installPerContextProperties(wrapper, impl.get(), isolate); |
618 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl, &info, wrappe
r, isolate, WrapperConfiguration::Independent); | 606 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl, &info, wrappe
r, isolate, WrapperConfiguration::Independent); |
619 return wrapper; | 607 return wrapper; |
620 } | 608 } |
621 void V8TestTypedefs::derefObject(void* object) | 609 void V8TestTypedefs::derefObject(void* object) |
622 { | 610 { |
623 fromInternalPointer(object)->deref(); | 611 fromInternalPointer(object)->deref(); |
624 } | 612 } |
625 | 613 |
626 } // namespace WebCore | 614 } // namespace WebCore |
OLD | NEW |