tizen beta release
[framework/web/webkit-efl.git] / DerivedSources / WebCore / JSDOMFormData.cpp
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 "JSDOMFormData.h"
23
24 #include "DOMFormData.h"
25 #include <runtime/Error.h>
26 #include <wtf/GetPtr.h>
27
28 using namespace JSC;
29
30 namespace WebCore {
31
32 ASSERT_CLASS_FITS_IN_CELL(JSDOMFormData);
33
34 /* Hash table */
35 #if ENABLE(JIT)
36 #define THUNK_GENERATOR(generator) , generator
37 #else
38 #define THUNK_GENERATOR(generator)
39 #endif
40 #if ENABLE(DFG_JIT)
41 #define INTRINSIC(intrinsic) , intrinsic
42 #else
43 #define INTRINSIC(intrinsic)
44 #endif
45
46 static const HashTableValue JSDOMFormDataTableValues[] =
47 {
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) }
50 };
51
52 #undef THUNK_GENERATOR
53 static const HashTable JSDOMFormDataTable = { 2, 1, JSDOMFormDataTableValues, 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 #if ENABLE(DFG_JIT)
61 #define INTRINSIC(intrinsic) , intrinsic
62 #else
63 #define INTRINSIC(intrinsic)
64 #endif
65
66 static const HashTableValue JSDOMFormDataConstructorTableValues[] =
67 {
68     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
69 };
70
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) };
74
75 JSDOMFormDataConstructor::JSDOMFormDataConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
76     : DOMConstructorObject(structure, globalObject)
77 {
78 }
79
80 void JSDOMFormDataConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
81 {
82     Base::finishCreation(exec->globalData());
83     ASSERT(inherits(&s_info));
84     putDirect(exec->globalData(), exec->propertyNames().prototype, JSDOMFormDataPrototype::self(exec, globalObject), DontDelete | ReadOnly);
85 }
86
87 bool JSDOMFormDataConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
88 {
89     return getStaticValueSlot<JSDOMFormDataConstructor, JSDOMWrapper>(exec, &JSDOMFormDataConstructorTable, static_cast<JSDOMFormDataConstructor*>(cell), propertyName, slot);
90 }
91
92 bool JSDOMFormDataConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
93 {
94     return getStaticValueDescriptor<JSDOMFormDataConstructor, JSDOMWrapper>(exec, &JSDOMFormDataConstructorTable, static_cast<JSDOMFormDataConstructor*>(object), propertyName, descriptor);
95 }
96
97 ConstructType JSDOMFormDataConstructor::getConstructData(JSCell*, ConstructData& constructData)
98 {
99     constructData.native.function = constructJSDOMFormData;
100     return ConstructTypeHost;
101 }
102
103 /* Hash table for prototype */
104 #if ENABLE(JIT)
105 #define THUNK_GENERATOR(generator) , generator
106 #else
107 #define THUNK_GENERATOR(generator)
108 #endif
109 #if ENABLE(DFG_JIT)
110 #define INTRINSIC(intrinsic) , intrinsic
111 #else
112 #define INTRINSIC(intrinsic)
113 #endif
114
115 static const HashTableValue JSDOMFormDataPrototypeTableValues[] =
116 {
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) }
119 };
120
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) };
124
125 JSObject* JSDOMFormDataPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
126 {
127     return getDOMPrototype<JSDOMFormData>(exec, globalObject);
128 }
129
130 bool JSDOMFormDataPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
131 {
132     JSDOMFormDataPrototype* thisObject = jsCast<JSDOMFormDataPrototype*>(cell);
133     return getStaticFunctionSlot<JSObject>(exec, &JSDOMFormDataPrototypeTable, thisObject, propertyName, slot);
134 }
135
136 bool JSDOMFormDataPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
137 {
138     JSDOMFormDataPrototype* thisObject = jsCast<JSDOMFormDataPrototype*>(object);
139     return getStaticFunctionDescriptor<JSObject>(exec, &JSDOMFormDataPrototypeTable, thisObject, propertyName, descriptor);
140 }
141
142 const ClassInfo JSDOMFormData::s_info = { "FormData", &JSDOMWrapper::s_info, &JSDOMFormDataTable, 0 , CREATE_METHOD_TABLE(JSDOMFormData) };
143
144 JSDOMFormData::JSDOMFormData(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<DOMFormData> impl)
145     : JSDOMWrapper(structure, globalObject)
146     , m_impl(impl.leakRef())
147 {
148 }
149
150 void JSDOMFormData::finishCreation(JSGlobalData& globalData)
151 {
152     Base::finishCreation(globalData);
153     ASSERT(inherits(&s_info));
154 }
155
156 JSObject* JSDOMFormData::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
157 {
158     return JSDOMFormDataPrototype::create(exec->globalData(), globalObject, JSDOMFormDataPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
159 }
160
161 bool JSDOMFormData::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
162 {
163     JSDOMFormData* thisObject = jsCast<JSDOMFormData*>(cell);
164     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
165     return getStaticValueSlot<JSDOMFormData, Base>(exec, &JSDOMFormDataTable, thisObject, propertyName, slot);
166 }
167
168 bool JSDOMFormData::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
169 {
170     JSDOMFormData* thisObject = jsCast<JSDOMFormData*>(object);
171     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
172     return getStaticValueDescriptor<JSDOMFormData, Base>(exec, &JSDOMFormDataTable, thisObject, propertyName, descriptor);
173 }
174
175 JSValue jsDOMFormDataConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
176 {
177     JSDOMFormData* domObject = static_cast<JSDOMFormData*>(asObject(slotBase));
178     return JSDOMFormData::getConstructor(exec, domObject->globalObject());
179 }
180
181 JSValue JSDOMFormData::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
182 {
183     return getDOMConstructor<JSDOMFormDataConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
184 }
185
186 EncodedJSValue JSC_HOST_CALL jsDOMFormDataPrototypeFunctionAppend(ExecState* exec)
187 {
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));
194 }
195
196 static inline bool isObservable(JSDOMFormData* jsDOMFormData)
197 {
198     if (jsDOMFormData->hasCustomProperties())
199         return true;
200     return false;
201 }
202
203 bool JSDOMFormDataOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
204 {
205     JSDOMFormData* jsDOMFormData = static_cast<JSDOMFormData*>(handle.get().asCell());
206     if (!isObservable(jsDOMFormData))
207         return false;
208     UNUSED_PARAM(visitor);
209     return false;
210 }
211
212 void JSDOMFormDataOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
213 {
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();
218 }
219
220 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DOMFormData* impl)
221 {
222     return wrap<JSDOMFormData>(exec, globalObject, impl);
223 }
224
225 DOMFormData* toDOMFormData(JSC::JSValue value)
226 {
227     return value.inherits(&JSDOMFormData::s_info) ? static_cast<JSDOMFormData*>(asObject(value))->impl() : 0;
228 }
229
230 }