|
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 #include "config.h" |
|
22 |
|
23 #if ENABLE(INDEXED_DATABASE) |
|
24 |
|
25 #include "JSIDBEvent.h" |
|
26 |
|
27 #include "IDBAny.h" |
|
28 #include "IDBEvent.h" |
|
29 #include "JSIDBAny.h" |
|
30 #include <wtf/GetPtr.h> |
|
31 |
|
32 using namespace JSC; |
|
33 |
|
34 namespace WebCore { |
|
35 |
|
36 ASSERT_CLASS_FITS_IN_CELL(JSIDBEvent); |
|
37 |
|
38 /* Hash table */ |
|
39 #if ENABLE(JIT) |
|
40 #define THUNK_GENERATOR(generator) , generator |
|
41 #else |
|
42 #define THUNK_GENERATOR(generator) |
|
43 #endif |
|
44 |
|
45 static const HashTableValue JSIDBEventTableValues[3] = |
|
46 { |
|
47 { "source", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBEventSource), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
48 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBEventConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
49 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
50 }; |
|
51 |
|
52 #undef THUNK_GENERATOR |
|
53 static JSC_CONST_HASHTABLE HashTable JSIDBEventTable = { 4, 3, JSIDBEventTableValues, 0 }; |
|
54 /* Hash table for constructor */ |
|
55 #if ENABLE(JIT) |
|
56 #define THUNK_GENERATOR(generator) , generator |
|
57 #else |
|
58 #define THUNK_GENERATOR(generator) |
|
59 #endif |
|
60 |
|
61 static const HashTableValue JSIDBEventConstructorTableValues[1] = |
|
62 { |
|
63 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
64 }; |
|
65 |
|
66 #undef THUNK_GENERATOR |
|
67 static JSC_CONST_HASHTABLE HashTable JSIDBEventConstructorTable = { 1, 0, JSIDBEventConstructorTableValues, 0 }; |
|
68 class JSIDBEventConstructor : public DOMConstructorObject { |
|
69 public: |
|
70 JSIDBEventConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
71 |
|
72 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
73 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
74 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
75 static const JSC::ClassInfo s_info; |
|
76 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
77 { |
|
78 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
79 } |
|
80 protected: |
|
81 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
82 }; |
|
83 |
|
84 const ClassInfo JSIDBEventConstructor::s_info = { "IDBEventConstructor", 0, &JSIDBEventConstructorTable, 0 }; |
|
85 |
|
86 JSIDBEventConstructor::JSIDBEventConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
87 : DOMConstructorObject(JSIDBEventConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
88 { |
|
89 putDirect(exec->propertyNames().prototype, JSIDBEventPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
90 } |
|
91 |
|
92 bool JSIDBEventConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
93 { |
|
94 return getStaticValueSlot<JSIDBEventConstructor, DOMObject>(exec, &JSIDBEventConstructorTable, this, propertyName, slot); |
|
95 } |
|
96 |
|
97 bool JSIDBEventConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
98 { |
|
99 return getStaticValueDescriptor<JSIDBEventConstructor, DOMObject>(exec, &JSIDBEventConstructorTable, this, propertyName, descriptor); |
|
100 } |
|
101 |
|
102 /* Hash table for prototype */ |
|
103 #if ENABLE(JIT) |
|
104 #define THUNK_GENERATOR(generator) , generator |
|
105 #else |
|
106 #define THUNK_GENERATOR(generator) |
|
107 #endif |
|
108 |
|
109 static const HashTableValue JSIDBEventPrototypeTableValues[1] = |
|
110 { |
|
111 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
112 }; |
|
113 |
|
114 #undef THUNK_GENERATOR |
|
115 static JSC_CONST_HASHTABLE HashTable JSIDBEventPrototypeTable = { 1, 0, JSIDBEventPrototypeTableValues, 0 }; |
|
116 const ClassInfo JSIDBEventPrototype::s_info = { "IDBEventPrototype", 0, &JSIDBEventPrototypeTable, 0 }; |
|
117 |
|
118 JSObject* JSIDBEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
119 { |
|
120 return getDOMPrototype<JSIDBEvent>(exec, globalObject); |
|
121 } |
|
122 |
|
123 const ClassInfo JSIDBEvent::s_info = { "IDBEvent", &JSEvent::s_info, &JSIDBEventTable, 0 }; |
|
124 |
|
125 JSIDBEvent::JSIDBEvent(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<IDBEvent> impl) |
|
126 : JSEvent(structure, globalObject, impl) |
|
127 { |
|
128 } |
|
129 |
|
130 JSObject* JSIDBEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
131 { |
|
132 return new (exec) JSIDBEventPrototype(globalObject, JSIDBEventPrototype::createStructure(JSEventPrototype::self(exec, globalObject))); |
|
133 } |
|
134 |
|
135 bool JSIDBEvent::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
136 { |
|
137 return getStaticValueSlot<JSIDBEvent, Base>(exec, &JSIDBEventTable, this, propertyName, slot); |
|
138 } |
|
139 |
|
140 bool JSIDBEvent::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
141 { |
|
142 return getStaticValueDescriptor<JSIDBEvent, Base>(exec, &JSIDBEventTable, this, propertyName, descriptor); |
|
143 } |
|
144 |
|
145 JSValue jsIDBEventSource(ExecState* exec, JSValue slotBase, const Identifier&) |
|
146 { |
|
147 JSIDBEvent* castedThis = static_cast<JSIDBEvent*>(asObject(slotBase)); |
|
148 UNUSED_PARAM(exec); |
|
149 IDBEvent* imp = static_cast<IDBEvent*>(castedThis->impl()); |
|
150 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->source())); |
|
151 return result; |
|
152 } |
|
153 |
|
154 JSValue jsIDBEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
155 { |
|
156 JSIDBEvent* domObject = static_cast<JSIDBEvent*>(asObject(slotBase)); |
|
157 return JSIDBEvent::getConstructor(exec, domObject->globalObject()); |
|
158 } |
|
159 JSValue JSIDBEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
160 { |
|
161 return getDOMConstructor<JSIDBEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
162 } |
|
163 |
|
164 |
|
165 } |
|
166 |
|
167 #endif // ENABLE(INDEXED_DATABASE) |