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 #if ENABLE(Condition1) || ENABLE(Condition2) | 22 #if ENABLE(Condition1) || ENABLE(Condition2) |
23 #include "V8TestInterface.h" | 23 #include "V8TestInterface.h" |
24 | 24 |
25 #include "RuntimeEnabledFeatures.h" | 25 #include "RuntimeEnabledFeatures.h" |
26 #include "V8Node.h" | 26 #include "V8Node.h" |
| 27 #include "V8NodeList.h" |
27 #include "V8TestObject.h" | 28 #include "V8TestObject.h" |
28 #include "bindings/bindings/tests/idls/TestPartialInterface.h" | 29 #include "bindings/bindings/tests/idls/TestPartialInterface.h" |
29 #include "bindings/v8/ScriptController.h" | 30 #include "bindings/v8/ScriptController.h" |
30 #include "bindings/v8/V8Binding.h" | 31 #include "bindings/v8/V8Binding.h" |
| 32 #include "bindings/v8/V8Collection.h" |
31 #include "bindings/v8/V8DOMConfiguration.h" | 33 #include "bindings/v8/V8DOMConfiguration.h" |
32 #include "bindings/v8/V8DOMWrapper.h" | 34 #include "bindings/v8/V8DOMWrapper.h" |
33 #include "bindings/v8/V8ObjectConstructor.h" | 35 #include "bindings/v8/V8ObjectConstructor.h" |
34 #include "core/dom/ContextFeatures.h" | 36 #include "core/dom/ContextFeatures.h" |
35 #include "core/dom/Document.h" | 37 #include "core/dom/Document.h" |
36 #include "core/dom/ExceptionCode.h" | 38 #include "core/dom/ExceptionCode.h" |
37 #include "core/page/Frame.h" | 39 #include "core/page/Frame.h" |
38 #include "wtf/GetPtr.h" | 40 #include "wtf/GetPtr.h" |
39 #include "wtf/RefCounted.h" | 41 #include "wtf/RefCounted.h" |
40 #include "wtf/RefPtr.h" | 42 #include "wtf/RefPtr.h" |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 { | 514 { |
513 if (!args.IsConstructCall()) | 515 if (!args.IsConstructCall()) |
514 return throwTypeError("DOM object constructor cannot be called as a func
tion.", args.GetIsolate()); | 516 return throwTypeError("DOM object constructor cannot be called as a func
tion.", args.GetIsolate()); |
515 | 517 |
516 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) | 518 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) |
517 return args.Holder(); | 519 return args.Holder(); |
518 | 520 |
519 return TestInterfaceV8Internal::constructor(args); | 521 return TestInterfaceV8Internal::constructor(args); |
520 } | 522 } |
521 | 523 |
| 524 v8::Handle<v8::Value> V8TestInterface::namedPropertyGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) |
| 525 { |
| 526 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
| 527 return v8Undefined(); |
| 528 if (info.Holder()->HasRealNamedCallbackProperty(name)) |
| 529 return v8Undefined(); |
| 530 |
| 531 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); |
| 532 TestInterface* collection = toNative(info.Holder()); |
| 533 AtomicString propertyName = toWebCoreAtomicString(name); |
| 534 RefPtr<Node> elementMember1; |
| 535 RefPtr<NodeList> elementMember2; |
| 536 collection->getItem(propertyName, elementMember1, elementMember2); |
| 537 if (!!elementMember1) |
| 538 return toV8Fast(elementMember1.release(), info, collection); |
| 539 if (!!elementMember2) |
| 540 return toV8Fast(elementMember2.release(), info, collection); |
| 541 return v8Undefined(); |
| 542 } |
| 543 |
522 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestInterfaceTemplate(v8:
:Persistent<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType c
urrentWorldType) | 544 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestInterfaceTemplate(v8:
:Persistent<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType c
urrentWorldType) |
523 { | 545 { |
524 desc->ReadOnlyPrototype(); | 546 desc->ReadOnlyPrototype(); |
525 | 547 |
526 v8::Local<v8::Signature> defaultSignature; | 548 v8::Local<v8::Signature> defaultSignature; |
527 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestInterfac
e", v8::Persistent<v8::FunctionTemplate>(), V8TestInterface::internalFieldCount, | 549 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestInterfac
e", v8::Persistent<v8::FunctionTemplate>(), V8TestInterface::internalFieldCount, |
528 V8TestInterfaceAttrs, WTF_ARRAY_LENGTH(V8TestInterfaceAttrs), | 550 V8TestInterfaceAttrs, WTF_ARRAY_LENGTH(V8TestInterfaceAttrs), |
529 V8TestInterfaceMethods, WTF_ARRAY_LENGTH(V8TestInterfaceMethods), isolat
e, currentWorldType); | 551 V8TestInterfaceMethods, WTF_ARRAY_LENGTH(V8TestInterfaceMethods), isolat
e, currentWorldType); |
530 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. | 552 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. |
531 desc->SetCallHandler(V8TestInterface::constructorCallback); | 553 desc->SetCallHandler(V8TestInterface::constructorCallback); |
532 desc->SetLength(1); | 554 desc->SetLength(1); |
533 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); | 555 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); |
534 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); | 556 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); |
535 UNUSED_PARAM(instance); // In some cases, it will not be used. | 557 UNUSED_PARAM(instance); // In some cases, it will not be used. |
536 UNUSED_PARAM(proto); // In some cases, it will not be used. | 558 UNUSED_PARAM(proto); // In some cases, it will not be used. |
537 | 559 |
538 #if ENABLE(Condition11) || ENABLE(Condition12) | 560 #if ENABLE(Condition11) || ENABLE(Condition12) |
539 if (RuntimeEnabledFeatures::condition13Enabled()) { | 561 if (RuntimeEnabledFeatures::condition13Enabled()) { |
540 static const V8DOMConfiguration::BatchedAttribute attrData =\ | 562 static const V8DOMConfiguration::BatchedAttribute attrData =\ |
541 // Attribute 'Node13' (Type: 'attribute' ExtAttr: 'EnabledAtRuntime Cond
itional ImplementedBy') | 563 // Attribute 'Node13' (Type: 'attribute' ExtAttr: 'EnabledAtRuntime Cond
itional ImplementedBy') |
542 {"Node13", TestInterfaceV8Internal::Node13AttrGetterCallback, TestInterf
aceV8Internal::Node13AttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::
AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /*
on instance */}; | 564 {"Node13", TestInterfaceV8Internal::Node13AttrGetterCallback, TestInterf
aceV8Internal::Node13AttrSetterCallback, 0, 0, 0 /* no data */, static_cast<v8::
AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /*
on instance */}; |
543 V8DOMConfiguration::configureAttribute(instance, proto, attrData, isolat
e, currentWorldType); | 565 V8DOMConfiguration::configureAttribute(instance, proto, attrData, isolat
e, currentWorldType); |
544 } | 566 } |
545 | 567 |
546 #endif // ENABLE(Condition11) || ENABLE(Condition12) | 568 #endif // ENABLE(Condition11) || ENABLE(Condition12) |
547 desc->InstanceTemplate()->SetNamedPropertyHandler(0, V8TestInterface::namedP
ropertySetter, 0, 0, 0); | 569 desc->InstanceTemplate()->SetNamedPropertyHandler(V8TestInterface::namedProp
ertyGetter, V8TestInterface::namedPropertySetter, 0, 0, 0); |
548 | 570 |
549 // Custom Signature 'supplementalMethod2' | 571 // Custom Signature 'supplementalMethod2' |
550 const int supplementalMethod2Argc = 2; | 572 const int supplementalMethod2Argc = 2; |
551 v8::Handle<v8::FunctionTemplate> supplementalMethod2Argv[supplementalMethod2
Argc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->r
awTemplate(&V8TestObject::info, currentWorldType) }; | 573 v8::Handle<v8::FunctionTemplate> supplementalMethod2Argv[supplementalMethod2
Argc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->r
awTemplate(&V8TestObject::info, currentWorldType) }; |
552 v8::Handle<v8::Signature> supplementalMethod2Signature = v8::Signature::New(
desc, supplementalMethod2Argc, supplementalMethod2Argv); | 574 v8::Handle<v8::Signature> supplementalMethod2Signature = v8::Signature::New(
desc, supplementalMethod2Argc, supplementalMethod2Argv); |
553 #if ENABLE(Condition11) || ENABLE(Condition12) | 575 #if ENABLE(Condition11) || ENABLE(Condition12) |
554 proto->Set(v8::String::NewSymbol("supplementalMethod2"), v8::FunctionTemplat
e::New(TestInterfaceV8Internal::supplementalMethod2MethodCallback, v8Undefined()
, supplementalMethod2Signature, 2)); | 576 proto->Set(v8::String::NewSymbol("supplementalMethod2"), v8::FunctionTemplat
e::New(TestInterfaceV8Internal::supplementalMethod2MethodCallback, v8Undefined()
, supplementalMethod2Signature, 2)); |
555 #endif // ENABLE(Condition11) || ENABLE(Condition12) | 577 #endif // ENABLE(Condition11) || ENABLE(Condition12) |
556 #if ENABLE(Condition11) || ENABLE(Condition12) | 578 #if ENABLE(Condition11) || ENABLE(Condition12) |
557 desc->Set(v8::String::NewSymbol("supplementalMethod4"), v8::FunctionTemplate
::New(TestInterfaceV8Internal::supplementalMethod4MethodCallback, v8Undefined(),
v8::Local<v8::Signature>(), 0)); | 579 desc->Set(v8::String::NewSymbol("supplementalMethod4"), v8::FunctionTemplate
::New(TestInterfaceV8Internal::supplementalMethod4MethodCallback, v8Undefined(),
v8::Local<v8::Signature>(), 0)); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 return wrapper; | 655 return wrapper; |
634 } | 656 } |
635 void V8TestInterface::derefObject(void* object) | 657 void V8TestInterface::derefObject(void* object) |
636 { | 658 { |
637 static_cast<TestInterface*>(object)->deref(); | 659 static_cast<TestInterface*>(object)->deref(); |
638 } | 660 } |
639 | 661 |
640 } // namespace WebCore | 662 } // namespace WebCore |
641 | 663 |
642 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 664 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
OLD | NEW |