OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 16 matching lines...) Expand all Loading... |
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 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! | 31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! |
32 | 32 |
33 #include "config.h" | 33 #include "config.h" |
34 #include "V8TestTypedefs.h" | 34 #include "V8TestTypedefs.h" |
35 | 35 |
36 #include "RuntimeEnabledFeatures.h" | 36 #include "RuntimeEnabledFeatures.h" |
37 #include "V8SerializedScriptValue.h" | |
38 #include "V8TestCallbackInterface.h" | 37 #include "V8TestCallbackInterface.h" |
| 38 #include "V8TestInterfaceEmpty.h" |
39 #include "V8TestSubObj.h" | 39 #include "V8TestSubObj.h" |
40 #include "bindings/v8/ExceptionState.h" | 40 #include "bindings/v8/ExceptionState.h" |
41 #include "bindings/v8/SerializedScriptValue.h" | |
42 #include "bindings/v8/V8DOMConfiguration.h" | 41 #include "bindings/v8/V8DOMConfiguration.h" |
43 #include "bindings/v8/V8ObjectConstructor.h" | 42 #include "bindings/v8/V8ObjectConstructor.h" |
44 #include "core/dom/ContextFeatures.h" | 43 #include "core/dom/ContextFeatures.h" |
45 #include "core/dom/Document.h" | 44 #include "core/dom/Document.h" |
46 #include "platform/TraceEvent.h" | 45 #include "platform/TraceEvent.h" |
47 | 46 |
48 namespace WebCore { | 47 namespace WebCore { |
49 | 48 |
50 static void initializeScriptWrappableForInterface(TestTypedefs* object) | 49 static void initializeScriptWrappableForInterface(TestTypedefs* object) |
51 { | 50 { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 imp->setUnsignedLongLongAttr(cppValue); | 93 imp->setUnsignedLongLongAttr(cppValue); |
95 } | 94 } |
96 | 95 |
97 static void unsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v
8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 96 static void unsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v
8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
98 { | 97 { |
99 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 98 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
100 TestTypedefsV8Internal::unsignedLongLongAttrAttributeSetter(jsValue, info); | 99 TestTypedefsV8Internal::unsignedLongLongAttrAttributeSetter(jsValue, info); |
101 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 100 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
102 } | 101 } |
103 | 102 |
104 static void immutableSerializedScriptValueAttributeGetter(const v8::PropertyCall
backInfo<v8::Value>& info) | |
105 { | |
106 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); | |
107 v8SetReturnValue(info, imp->immutableSerializedScriptValue() ? imp->immutabl
eSerializedScriptValue()->deserialize() : v8::Handle<v8::Value>(v8::Null(info.Ge
tIsolate()))); | |
108 } | |
109 | |
110 static void immutableSerializedScriptValueAttributeGetterCallback(v8::Local<v8::
String>, const v8::PropertyCallbackInfo<v8::Value>& info) | |
111 { | |
112 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | |
113 TestTypedefsV8Internal::immutableSerializedScriptValueAttributeGetter(info); | |
114 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | |
115 } | |
116 | |
117 static void immutableSerializedScriptValueAttributeSetter(v8::Local<v8::Value> j
sValue, const v8::PropertyCallbackInfo<void>& info) | |
118 { | |
119 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); | |
120 V8TRYCATCH_VOID(RefPtr<SerializedScriptValue>, cppValue, SerializedScriptVal
ue::create(jsValue, info.GetIsolate())); | |
121 imp->setImmutableSerializedScriptValue(WTF::getPtr(cppValue)); | |
122 } | |
123 | |
124 static void immutableSerializedScriptValueAttributeSetterCallback(v8::Local<v8::
String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf
o) | |
125 { | |
126 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | |
127 TestTypedefsV8Internal::immutableSerializedScriptValueAttributeSetter(jsValu
e, info); | |
128 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | |
129 } | |
130 | |
131 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInf
o<v8::Value>& info) | 103 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInf
o<v8::Value>& info) |
132 { | 104 { |
133 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); | 105 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); |
134 ExceptionState exceptionState(ExceptionState::GetterContext, "attrWithGetter
Exception", "TestTypedefs", info.Holder(), info.GetIsolate()); | 106 ExceptionState exceptionState(ExceptionState::GetterContext, "attrWithGetter
Exception", "TestTypedefs", info.Holder(), info.GetIsolate()); |
135 int jsValue = imp->attrWithGetterException(exceptionState); | 107 int jsValue = imp->attrWithGetterException(exceptionState); |
136 if (UNLIKELY(exceptionState.throwIfNeeded())) | 108 if (UNLIKELY(exceptionState.throwIfNeeded())) |
137 return; | 109 return; |
138 v8SetReturnValueInt(info, jsValue); | 110 v8SetReturnValueInt(info, jsValue); |
139 } | 111 } |
140 | 112 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 311 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
340 } | 312 } |
341 | 313 |
342 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) | 314 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
343 { | 315 { |
344 if (UNLIKELY(info.Length() < 1)) { | 316 if (UNLIKELY(info.Length() < 1)) { |
345 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg
", "TestTypedefs", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); | 317 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg
", "TestTypedefs", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); |
346 return; | 318 return; |
347 } | 319 } |
348 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); | 320 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); |
349 V8TRYCATCH_VOID(Vector<RefPtr<SerializedScriptValue> >, sequenceArg, (toRefP
trNativeArray<SerializedScriptValue, V8SerializedScriptValue>(info[0], 1, info.G
etIsolate()))); | 321 V8TRYCATCH_VOID(Vector<RefPtr<TestInterfaceEmpty> >, sequenceArg, (toRefPtrN
ativeArray<TestInterfaceEmpty, V8TestInterfaceEmpty>(info[0], 1, info.GetIsolate
()))); |
350 v8SetReturnValue(info, static_cast<double>(imp->methodWithSequenceArg(sequen
ceArg))); | 322 v8SetReturnValue(info, static_cast<double>(imp->methodWithSequenceArg(sequen
ceArg))); |
351 } | 323 } |
352 | 324 |
353 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 325 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
354 { | 326 { |
355 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 327 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
356 TestTypedefsV8Internal::methodWithSequenceArgMethod(info); | 328 TestTypedefsV8Internal::methodWithSequenceArgMethod(info); |
357 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 329 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
358 } | 330 } |
359 | 331 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 v8::Handle<v8::Object> wrapper = info.Holder(); | 402 v8::Handle<v8::Object> wrapper = info.Holder(); |
431 | 403 |
432 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl.release(), &V8
TestTypedefs::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration:
:Dependent); | 404 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl.release(), &V8
TestTypedefs::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration:
:Dependent); |
433 v8SetReturnValue(info, wrapper); | 405 v8SetReturnValue(info, wrapper); |
434 } | 406 } |
435 | 407 |
436 } // namespace TestTypedefsV8Internal | 408 } // namespace TestTypedefsV8Internal |
437 | 409 |
438 static const V8DOMConfiguration::AttributeConfiguration V8TestTypedefsAttributes
[] = { | 410 static const V8DOMConfiguration::AttributeConfiguration V8TestTypedefsAttributes
[] = { |
439 {"unsignedLongLongAttr", TestTypedefsV8Internal::unsignedLongLongAttrAttribu
teGetterCallback, TestTypedefsV8Internal::unsignedLongLongAttrAttributeSetterCal
lback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pro
pertyAttribute>(v8::None), 0 /* on instance */}, | 411 {"unsignedLongLongAttr", TestTypedefsV8Internal::unsignedLongLongAttrAttribu
teGetterCallback, TestTypedefsV8Internal::unsignedLongLongAttrAttributeSetterCal
lback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pro
pertyAttribute>(v8::None), 0 /* on instance */}, |
440 {"immutableSerializedScriptValue", TestTypedefsV8Internal::immutableSerializ
edScriptValueAttributeGetterCallback, TestTypedefsV8Internal::immutableSerialize
dScriptValueAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8:
:DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 412 {"TestSubObj", TestTypedefsV8Internal::TestTypedefsConstructorGetter, TestTy
pedefsV8Internal::TestTypedefsReplaceableAttributeSetterCallback, 0, 0, const_ca
st<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo), static_cast<v8::AccessCont
rol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on ins
tance */}, |
441 {"attrWithGetterException", TestTypedefsV8Internal::attrWithGetterExceptionA
ttributeGetterCallback, TestTypedefsV8Internal::attrWithGetterExceptionAttribute
SetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas
t<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 413 {"attrWithGetterException", TestTypedefsV8Internal::attrWithGetterExceptionA
ttributeGetterCallback, TestTypedefsV8Internal::attrWithGetterExceptionAttribute
SetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas
t<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
442 {"attrWithSetterException", TestTypedefsV8Internal::attrWithSetterExceptionA
ttributeGetterCallback, TestTypedefsV8Internal::attrWithSetterExceptionAttribute
SetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas
t<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 414 {"attrWithSetterException", TestTypedefsV8Internal::attrWithSetterExceptionA
ttributeGetterCallback, TestTypedefsV8Internal::attrWithSetterExceptionAttribute
SetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas
t<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
443 {"stringAttrWithGetterException", TestTypedefsV8Internal::stringAttrWithGett
erExceptionAttributeGetterCallback, TestTypedefsV8Internal::stringAttrWithGetter
ExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DE
FAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 415 {"stringAttrWithGetterException", TestTypedefsV8Internal::stringAttrWithGett
erExceptionAttributeGetterCallback, TestTypedefsV8Internal::stringAttrWithGetter
ExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DE
FAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
444 {"stringAttrWithSetterException", TestTypedefsV8Internal::stringAttrWithSett
erExceptionAttributeGetterCallback, TestTypedefsV8Internal::stringAttrWithSetter
ExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DE
FAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 416 {"stringAttrWithSetterException", TestTypedefsV8Internal::stringAttrWithSett
erExceptionAttributeGetterCallback, TestTypedefsV8Internal::stringAttrWithSetter
ExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DE
FAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
445 }; | 417 }; |
446 | 418 |
447 static const V8DOMConfiguration::MethodConfiguration V8TestTypedefsMethods[] = { | 419 static const V8DOMConfiguration::MethodConfiguration V8TestTypedefsMethods[] = { |
448 {"func", TestTypedefsV8Internal::funcMethodCallback, 0, 0}, | 420 {"func", TestTypedefsV8Internal::funcMethodCallback, 0, 0}, |
449 {"setShadow", TestTypedefsV8Internal::setShadowMethodCallback, 0, 3}, | 421 {"setShadow", TestTypedefsV8Internal::setShadowMethodCallback, 0, 3}, |
450 {"voidMethodTestCallbackInterfaceArgument", TestTypedefsV8Internal::voidMeth
odTestCallbackInterfaceArgumentMethodCallback, 0, 1}, | 422 {"voidMethodTestCallbackInterfaceArgument", TestTypedefsV8Internal::voidMeth
odTestCallbackInterfaceArgumentMethodCallback, 0, 1}, |
(...skipping 26 matching lines...) Expand all Loading... |
477 v8::Local<v8::Signature> defaultSignature; | 449 v8::Local<v8::Signature> defaultSignature; |
478 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestTypedefs", v8::Local<v8::FunctionTemplate>(), V8TestTypedefs::internal
FieldCount, | 450 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestTypedefs", v8::Local<v8::FunctionTemplate>(), V8TestTypedefs::internal
FieldCount, |
479 V8TestTypedefsAttributes, WTF_ARRAY_LENGTH(V8TestTypedefsAttributes), | 451 V8TestTypedefsAttributes, WTF_ARRAY_LENGTH(V8TestTypedefsAttributes), |
480 0, 0, | 452 0, 0, |
481 V8TestTypedefsMethods, WTF_ARRAY_LENGTH(V8TestTypedefsMethods), | 453 V8TestTypedefsMethods, WTF_ARRAY_LENGTH(V8TestTypedefsMethods), |
482 isolate, currentWorldType); | 454 isolate, currentWorldType); |
483 functionTemplate->SetCallHandler(V8TestTypedefs::constructorCallback); | 455 functionTemplate->SetCallHandler(V8TestTypedefs::constructorCallback); |
484 functionTemplate->SetLength(1); | 456 functionTemplate->SetLength(1); |
485 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); | 457 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
486 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); | 458 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
487 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "TestSubObj"
), TestTypedefsV8Internal::TestTypedefsConstructorGetter, 0, v8::External::New(i
solate, const_cast<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo)), static_ca
st<v8::PropertyAttribute>(v8::DontEnum), v8::Handle<v8::AccessorSignature>(), st
atic_cast<v8::AccessControl>(v8::DEFAULT)); | |
488 | 459 |
489 // Custom toString template | 460 // Custom toString template |
490 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); | 461 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); |
491 } | 462 } |
492 | 463 |
493 v8::Handle<v8::FunctionTemplate> V8TestTypedefs::domTemplate(v8::Isolate* isolat
e, WrapperWorldType currentWorldType) | 464 v8::Handle<v8::FunctionTemplate> V8TestTypedefs::domTemplate(v8::Isolate* isolat
e, WrapperWorldType currentWorldType) |
494 { | 465 { |
495 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 466 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
496 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 467 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
497 if (result != data->templateMap(currentWorldType).end()) | 468 if (result != data->templateMap(currentWorldType).end()) |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 fromInternalPointer(object)->deref(); | 513 fromInternalPointer(object)->deref(); |
543 } | 514 } |
544 | 515 |
545 template<> | 516 template<> |
546 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) | 517 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) |
547 { | 518 { |
548 return toV8(impl, creationContext, isolate); | 519 return toV8(impl, creationContext, isolate); |
549 } | 520 } |
550 | 521 |
551 } // namespace WebCore | 522 } // namespace WebCore |
OLD | NEW |