2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
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.
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.
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.
22 #include "JSDOMFormData.h"
24 #include "DOMFormData.h"
25 #include <runtime/Error.h>
26 #include <wtf/GetPtr.h>
32 ASSERT_CLASS_FITS_IN_CELL(JSDOMFormData);
36 #define THUNK_GENERATOR(generator) , generator
38 #define THUNK_GENERATOR(generator)
41 #define INTRINSIC(intrinsic) , intrinsic
43 #define INTRINSIC(intrinsic)
46 static const HashTableValue JSDOMFormDataTableValues[] =
48 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMFormDataConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
49 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
52 #undef THUNK_GENERATOR
53 static const HashTable JSDOMFormDataTable = { 2, 1, JSDOMFormDataTableValues, 0 };
54 /* Hash table for constructor */
56 #define THUNK_GENERATOR(generator) , generator
58 #define THUNK_GENERATOR(generator)
61 #define INTRINSIC(intrinsic) , intrinsic
63 #define INTRINSIC(intrinsic)
66 static const HashTableValue JSDOMFormDataConstructorTableValues[] =
68 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
71 #undef THUNK_GENERATOR
72 static const HashTable JSDOMFormDataConstructorTable = { 1, 0, JSDOMFormDataConstructorTableValues, 0 };
73 const ClassInfo JSDOMFormDataConstructor::s_info = { "FormDataConstructor", &DOMConstructorObject::s_info, &JSDOMFormDataConstructorTable, 0, CREATE_METHOD_TABLE(JSDOMFormDataConstructor) };
75 JSDOMFormDataConstructor::JSDOMFormDataConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
76 : DOMConstructorObject(structure, globalObject)
80 void JSDOMFormDataConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
82 Base::finishCreation(exec->globalData());
83 ASSERT(inherits(&s_info));
84 putDirect(exec->globalData(), exec->propertyNames().prototype, JSDOMFormDataPrototype::self(exec, globalObject), DontDelete | ReadOnly);
87 bool JSDOMFormDataConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
89 return getStaticValueSlot<JSDOMFormDataConstructor, JSDOMWrapper>(exec, &JSDOMFormDataConstructorTable, static_cast<JSDOMFormDataConstructor*>(cell), propertyName, slot);
92 bool JSDOMFormDataConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
94 return getStaticValueDescriptor<JSDOMFormDataConstructor, JSDOMWrapper>(exec, &JSDOMFormDataConstructorTable, static_cast<JSDOMFormDataConstructor*>(object), propertyName, descriptor);
97 ConstructType JSDOMFormDataConstructor::getConstructData(JSCell*, ConstructData& constructData)
99 constructData.native.function = constructJSDOMFormData;
100 return ConstructTypeHost;
103 /* Hash table for prototype */
105 #define THUNK_GENERATOR(generator) , generator
107 #define THUNK_GENERATOR(generator)
110 #define INTRINSIC(intrinsic) , intrinsic
112 #define INTRINSIC(intrinsic)
115 static const HashTableValue JSDOMFormDataPrototypeTableValues[] =
117 { "append", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDOMFormDataPrototypeFunctionAppend), (intptr_t)3 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
118 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
121 #undef THUNK_GENERATOR
122 static const HashTable JSDOMFormDataPrototypeTable = { 2, 1, JSDOMFormDataPrototypeTableValues, 0 };
123 const ClassInfo JSDOMFormDataPrototype::s_info = { "FormDataPrototype", &JSC::JSNonFinalObject::s_info, &JSDOMFormDataPrototypeTable, 0, CREATE_METHOD_TABLE(JSDOMFormDataPrototype) };
125 JSObject* JSDOMFormDataPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
127 return getDOMPrototype<JSDOMFormData>(exec, globalObject);
130 bool JSDOMFormDataPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
132 JSDOMFormDataPrototype* thisObject = jsCast<JSDOMFormDataPrototype*>(cell);
133 return getStaticFunctionSlot<JSObject>(exec, &JSDOMFormDataPrototypeTable, thisObject, propertyName, slot);
136 bool JSDOMFormDataPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
138 JSDOMFormDataPrototype* thisObject = jsCast<JSDOMFormDataPrototype*>(object);
139 return getStaticFunctionDescriptor<JSObject>(exec, &JSDOMFormDataPrototypeTable, thisObject, propertyName, descriptor);
142 const ClassInfo JSDOMFormData::s_info = { "FormData", &JSDOMWrapper::s_info, &JSDOMFormDataTable, 0 , CREATE_METHOD_TABLE(JSDOMFormData) };
144 JSDOMFormData::JSDOMFormData(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<DOMFormData> impl)
145 : JSDOMWrapper(structure, globalObject)
146 , m_impl(impl.leakRef())
150 void JSDOMFormData::finishCreation(JSGlobalData& globalData)
152 Base::finishCreation(globalData);
153 ASSERT(inherits(&s_info));
156 JSObject* JSDOMFormData::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
158 return JSDOMFormDataPrototype::create(exec->globalData(), globalObject, JSDOMFormDataPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
161 bool JSDOMFormData::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
163 JSDOMFormData* thisObject = jsCast<JSDOMFormData*>(cell);
164 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
165 return getStaticValueSlot<JSDOMFormData, Base>(exec, &JSDOMFormDataTable, thisObject, propertyName, slot);
168 bool JSDOMFormData::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
170 JSDOMFormData* thisObject = jsCast<JSDOMFormData*>(object);
171 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
172 return getStaticValueDescriptor<JSDOMFormData, Base>(exec, &JSDOMFormDataTable, thisObject, propertyName, descriptor);
175 JSValue jsDOMFormDataConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
177 JSDOMFormData* domObject = static_cast<JSDOMFormData*>(asObject(slotBase));
178 return JSDOMFormData::getConstructor(exec, domObject->globalObject());
181 JSValue JSDOMFormData::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
183 return getDOMConstructor<JSDOMFormDataConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
186 EncodedJSValue JSC_HOST_CALL jsDOMFormDataPrototypeFunctionAppend(ExecState* exec)
188 JSValue thisValue = exec->hostThisValue();
189 if (!thisValue.inherits(&JSDOMFormData::s_info))
190 return throwVMTypeError(exec);
191 JSDOMFormData* castedThis = static_cast<JSDOMFormData*>(asObject(thisValue));
192 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSDOMFormData::s_info);
193 return JSValue::encode(castedThis->append(exec));
196 static inline bool isObservable(JSDOMFormData* jsDOMFormData)
198 if (jsDOMFormData->hasCustomProperties())
203 bool JSDOMFormDataOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
205 JSDOMFormData* jsDOMFormData = static_cast<JSDOMFormData*>(handle.get().asCell());
206 if (!isObservable(jsDOMFormData))
208 UNUSED_PARAM(visitor);
212 void JSDOMFormDataOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
214 JSDOMFormData* jsDOMFormData = static_cast<JSDOMFormData*>(handle.get().asCell());
215 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
216 uncacheWrapper(world, jsDOMFormData->impl(), jsDOMFormData);
217 jsDOMFormData->releaseImpl();
220 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DOMFormData* impl)
222 return wrap<JSDOMFormData>(exec, globalObject, impl);
225 DOMFormData* toDOMFormData(JSC::JSValue value)
227 return value.inherits(&JSDOMFormData::s_info) ? static_cast<JSDOMFormData*>(asObject(value))->impl() : 0;