1/* 2 This file is part of the WebKit open source project. 3 This file has been generated by generate-bindings.pl. DO NOT MODIFY! 4 5 This library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Library General Public 7 License as published by the Free Software Foundation; either 8 version 2 of the License, or (at your option) any later version. 9 10 This library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Library General Public License for more details. 14 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 17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 Boston, MA 02110-1301, USA. 19*/ 20 21#ifndef JSTestNamedConstructor_h 22#define JSTestNamedConstructor_h 23 24#include "JSDOMBinding.h" 25#include "TestNamedConstructor.h" 26#include <runtime/JSGlobalObject.h> 27#include <runtime/JSObject.h> 28#include <runtime/ObjectPrototype.h> 29 30namespace WebCore { 31 32class JSTestNamedConstructor : public JSDOMWrapper { 33public: 34 typedef JSDOMWrapper Base; 35 static JSTestNamedConstructor* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestNamedConstructor> impl) 36 { 37 JSTestNamedConstructor* ptr = new (NotNull, JSC::allocateCell<JSTestNamedConstructor>(globalObject->vm().heap)) JSTestNamedConstructor(structure, globalObject, impl); 38 ptr->finishCreation(globalObject->vm()); 39 return ptr; 40 } 41 42 static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*); 43 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&); 44 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&); 45 static void destroy(JSC::JSCell*); 46 ~JSTestNamedConstructor(); 47 static const JSC::ClassInfo s_info; 48 49 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) 50 { 51 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info); 52 } 53 54 static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*); 55 static JSC::JSValue getNamedConstructor(JSC::ExecState*, JSC::JSGlobalObject*); 56 TestNamedConstructor* impl() const { return m_impl; } 57 void releaseImpl() { m_impl->deref(); m_impl = 0; } 58 59 void releaseImplIfNotNull() 60 { 61 if (m_impl) { 62 m_impl->deref(); 63 m_impl = 0; 64 } 65 } 66 67private: 68 TestNamedConstructor* m_impl; 69protected: 70 JSTestNamedConstructor(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestNamedConstructor>); 71 void finishCreation(JSC::VM&); 72 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | Base::StructureFlags; 73}; 74 75class JSTestNamedConstructorOwner : public JSC::WeakHandleOwner { 76public: 77 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&); 78 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 79}; 80 81inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, TestNamedConstructor*) 82{ 83 DEFINE_STATIC_LOCAL(JSTestNamedConstructorOwner, jsTestNamedConstructorOwner, ()); 84 return &jsTestNamedConstructorOwner; 85} 86 87inline void* wrapperContext(DOMWrapperWorld* world, TestNamedConstructor*) 88{ 89 return world; 90} 91 92JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNamedConstructor*); 93TestNamedConstructor* toTestNamedConstructor(JSC::JSValue); 94 95class JSTestNamedConstructorPrototype : public JSC::JSNonFinalObject { 96public: 97 typedef JSC::JSNonFinalObject Base; 98 static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*); 99 static JSTestNamedConstructorPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) 100 { 101 JSTestNamedConstructorPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestNamedConstructorPrototype>(vm.heap)) JSTestNamedConstructorPrototype(vm, globalObject, structure); 102 ptr->finishCreation(vm); 103 return ptr; 104 } 105 106 static const JSC::ClassInfo s_info; 107 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) 108 { 109 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info); 110 } 111 112private: 113 JSTestNamedConstructorPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(vm, structure) { } 114protected: 115 static const unsigned StructureFlags = Base::StructureFlags; 116}; 117 118class JSTestNamedConstructorConstructor : public DOMConstructorObject { 119private: 120 JSTestNamedConstructorConstructor(JSC::Structure*, JSDOMGlobalObject*); 121 void finishCreation(JSC::ExecState*, JSDOMGlobalObject*); 122 123public: 124 typedef DOMConstructorObject Base; 125 static JSTestNamedConstructorConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject) 126 { 127 JSTestNamedConstructorConstructor* ptr = new (NotNull, JSC::allocateCell<JSTestNamedConstructorConstructor>(*exec->heap())) JSTestNamedConstructorConstructor(structure, globalObject); 128 ptr->finishCreation(exec, globalObject); 129 return ptr; 130 } 131 132 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&); 133 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&); 134 static const JSC::ClassInfo s_info; 135 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) 136 { 137 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info); 138 } 139protected: 140 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; 141}; 142 143class JSTestNamedConstructorNamedConstructor : public DOMConstructorWithDocument { 144public: 145 typedef DOMConstructorWithDocument Base; 146 147 static JSTestNamedConstructorNamedConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject) 148 { 149 JSTestNamedConstructorNamedConstructor* constructor = new (NotNull, JSC::allocateCell<JSTestNamedConstructorNamedConstructor>(*exec->heap())) JSTestNamedConstructorNamedConstructor(structure, globalObject); 150 constructor->finishCreation(exec, globalObject); 151 return constructor; 152 } 153 154 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) 155 { 156 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info); 157 } 158 159 static const JSC::ClassInfo s_info; 160 161private: 162 JSTestNamedConstructorNamedConstructor(JSC::Structure*, JSDOMGlobalObject*); 163 static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestNamedConstructor(JSC::ExecState*); 164 static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&); 165 void finishCreation(JSC::ExecState*, JSDOMGlobalObject*); 166}; 167 168// Attributes 169 170JSC::JSValue jsTestNamedConstructorConstructor(JSC::ExecState*, JSC::JSValue, JSC::PropertyName); 171 172} // namespace WebCore 173 174#endif 175