|
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 #include "JSProgressEvent.h" |
|
23 |
|
24 #include "ProgressEvent.h" |
|
25 #include <runtime/Error.h> |
|
26 #include <runtime/JSNumberCell.h> |
|
27 #include <wtf/GetPtr.h> |
|
28 |
|
29 using namespace JSC; |
|
30 |
|
31 namespace WebCore { |
|
32 |
|
33 ASSERT_CLASS_FITS_IN_CELL(JSProgressEvent); |
|
34 |
|
35 /* Hash table */ |
|
36 #if ENABLE(JIT) |
|
37 #define THUNK_GENERATOR(generator) , generator |
|
38 #else |
|
39 #define THUNK_GENERATOR(generator) |
|
40 #endif |
|
41 |
|
42 static const HashTableValue JSProgressEventTableValues[5] = |
|
43 { |
|
44 { "lengthComputable", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsProgressEventLengthComputable), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
45 { "loaded", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsProgressEventLoaded), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
46 { "total", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsProgressEventTotal), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
47 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsProgressEventConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
48 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
49 }; |
|
50 |
|
51 #undef THUNK_GENERATOR |
|
52 static JSC_CONST_HASHTABLE HashTable JSProgressEventTable = { 9, 7, JSProgressEventTableValues, 0 }; |
|
53 /* Hash table for constructor */ |
|
54 #if ENABLE(JIT) |
|
55 #define THUNK_GENERATOR(generator) , generator |
|
56 #else |
|
57 #define THUNK_GENERATOR(generator) |
|
58 #endif |
|
59 |
|
60 static const HashTableValue JSProgressEventConstructorTableValues[1] = |
|
61 { |
|
62 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
63 }; |
|
64 |
|
65 #undef THUNK_GENERATOR |
|
66 static JSC_CONST_HASHTABLE HashTable JSProgressEventConstructorTable = { 1, 0, JSProgressEventConstructorTableValues, 0 }; |
|
67 class JSProgressEventConstructor : public DOMConstructorObject { |
|
68 public: |
|
69 JSProgressEventConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
70 |
|
71 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
72 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
73 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
74 static const JSC::ClassInfo s_info; |
|
75 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
76 { |
|
77 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
78 } |
|
79 protected: |
|
80 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
81 }; |
|
82 |
|
83 const ClassInfo JSProgressEventConstructor::s_info = { "ProgressEventConstructor", 0, &JSProgressEventConstructorTable, 0 }; |
|
84 |
|
85 JSProgressEventConstructor::JSProgressEventConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
86 : DOMConstructorObject(JSProgressEventConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
87 { |
|
88 putDirect(exec->propertyNames().prototype, JSProgressEventPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
89 } |
|
90 |
|
91 bool JSProgressEventConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
92 { |
|
93 return getStaticValueSlot<JSProgressEventConstructor, DOMObject>(exec, &JSProgressEventConstructorTable, this, propertyName, slot); |
|
94 } |
|
95 |
|
96 bool JSProgressEventConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
97 { |
|
98 return getStaticValueDescriptor<JSProgressEventConstructor, DOMObject>(exec, &JSProgressEventConstructorTable, this, propertyName, descriptor); |
|
99 } |
|
100 |
|
101 /* Hash table for prototype */ |
|
102 #if ENABLE(JIT) |
|
103 #define THUNK_GENERATOR(generator) , generator |
|
104 #else |
|
105 #define THUNK_GENERATOR(generator) |
|
106 #endif |
|
107 |
|
108 static const HashTableValue JSProgressEventPrototypeTableValues[2] = |
|
109 { |
|
110 { "initProgressEvent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsProgressEventPrototypeFunctionInitProgressEvent), (intptr_t)6 THUNK_GENERATOR(0) }, |
|
111 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
112 }; |
|
113 |
|
114 #undef THUNK_GENERATOR |
|
115 static JSC_CONST_HASHTABLE HashTable JSProgressEventPrototypeTable = { 2, 1, JSProgressEventPrototypeTableValues, 0 }; |
|
116 const ClassInfo JSProgressEventPrototype::s_info = { "ProgressEventPrototype", 0, &JSProgressEventPrototypeTable, 0 }; |
|
117 |
|
118 JSObject* JSProgressEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
119 { |
|
120 return getDOMPrototype<JSProgressEvent>(exec, globalObject); |
|
121 } |
|
122 |
|
123 bool JSProgressEventPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
124 { |
|
125 return getStaticFunctionSlot<JSObject>(exec, &JSProgressEventPrototypeTable, this, propertyName, slot); |
|
126 } |
|
127 |
|
128 bool JSProgressEventPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
129 { |
|
130 return getStaticFunctionDescriptor<JSObject>(exec, &JSProgressEventPrototypeTable, this, propertyName, descriptor); |
|
131 } |
|
132 |
|
133 const ClassInfo JSProgressEvent::s_info = { "ProgressEvent", &JSEvent::s_info, &JSProgressEventTable, 0 }; |
|
134 |
|
135 JSProgressEvent::JSProgressEvent(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<ProgressEvent> impl) |
|
136 : JSEvent(structure, globalObject, impl) |
|
137 { |
|
138 } |
|
139 |
|
140 JSObject* JSProgressEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
141 { |
|
142 return new (exec) JSProgressEventPrototype(globalObject, JSProgressEventPrototype::createStructure(JSEventPrototype::self(exec, globalObject))); |
|
143 } |
|
144 |
|
145 bool JSProgressEvent::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
146 { |
|
147 return getStaticValueSlot<JSProgressEvent, Base>(exec, &JSProgressEventTable, this, propertyName, slot); |
|
148 } |
|
149 |
|
150 bool JSProgressEvent::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
151 { |
|
152 return getStaticValueDescriptor<JSProgressEvent, Base>(exec, &JSProgressEventTable, this, propertyName, descriptor); |
|
153 } |
|
154 |
|
155 JSValue jsProgressEventLengthComputable(ExecState* exec, JSValue slotBase, const Identifier&) |
|
156 { |
|
157 JSProgressEvent* castedThis = static_cast<JSProgressEvent*>(asObject(slotBase)); |
|
158 UNUSED_PARAM(exec); |
|
159 ProgressEvent* imp = static_cast<ProgressEvent*>(castedThis->impl()); |
|
160 JSValue result = jsBoolean(imp->lengthComputable()); |
|
161 return result; |
|
162 } |
|
163 |
|
164 JSValue jsProgressEventLoaded(ExecState* exec, JSValue slotBase, const Identifier&) |
|
165 { |
|
166 JSProgressEvent* castedThis = static_cast<JSProgressEvent*>(asObject(slotBase)); |
|
167 UNUSED_PARAM(exec); |
|
168 ProgressEvent* imp = static_cast<ProgressEvent*>(castedThis->impl()); |
|
169 JSValue result = jsNumber(exec, imp->loaded()); |
|
170 return result; |
|
171 } |
|
172 |
|
173 JSValue jsProgressEventTotal(ExecState* exec, JSValue slotBase, const Identifier&) |
|
174 { |
|
175 JSProgressEvent* castedThis = static_cast<JSProgressEvent*>(asObject(slotBase)); |
|
176 UNUSED_PARAM(exec); |
|
177 ProgressEvent* imp = static_cast<ProgressEvent*>(castedThis->impl()); |
|
178 JSValue result = jsNumber(exec, imp->total()); |
|
179 return result; |
|
180 } |
|
181 |
|
182 JSValue jsProgressEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
183 { |
|
184 JSProgressEvent* domObject = static_cast<JSProgressEvent*>(asObject(slotBase)); |
|
185 return JSProgressEvent::getConstructor(exec, domObject->globalObject()); |
|
186 } |
|
187 JSValue JSProgressEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
188 { |
|
189 return getDOMConstructor<JSProgressEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
190 } |
|
191 |
|
192 EncodedJSValue JSC_HOST_CALL jsProgressEventPrototypeFunctionInitProgressEvent(ExecState* exec) |
|
193 { |
|
194 JSValue thisValue = exec->hostThisValue(); |
|
195 if (!thisValue.inherits(&JSProgressEvent::s_info)) |
|
196 return throwVMTypeError(exec); |
|
197 JSProgressEvent* castedThis = static_cast<JSProgressEvent*>(asObject(thisValue)); |
|
198 ProgressEvent* imp = static_cast<ProgressEvent*>(castedThis->impl()); |
|
199 const String& typeArg = ustringToString(exec->argument(0).toString(exec)); |
|
200 bool canBubbleArg = exec->argument(1).toBoolean(exec); |
|
201 bool cancelableArg = exec->argument(2).toBoolean(exec); |
|
202 bool lengthComputableArg = exec->argument(3).toBoolean(exec); |
|
203 unsigned loadedArg = exec->argument(4).toInt32(exec); |
|
204 unsigned totalArg = exec->argument(5).toInt32(exec); |
|
205 |
|
206 imp->initProgressEvent(typeArg, canBubbleArg, cancelableArg, lengthComputableArg, loadedArg, totalArg); |
|
207 return JSValue::encode(jsUndefined()); |
|
208 } |
|
209 |
|
210 |
|
211 } |