tizen beta release
[profile/ivi/webkit-efl.git] / DerivedSources / WebCore / JSDOMMimeType.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 "JSDOMMimeType.h"
23
24 #include "DOMMimeType.h"
25 #include "DOMPlugin.h"
26 #include "JSDOMPlugin.h"
27 #include "KURL.h"
28 #include <runtime/JSString.h>
29 #include <wtf/GetPtr.h>
30
31 using namespace JSC;
32
33 namespace WebCore {
34
35 ASSERT_CLASS_FITS_IN_CELL(JSDOMMimeType);
36
37 /* Hash table */
38 #if ENABLE(JIT)
39 #define THUNK_GENERATOR(generator) , generator
40 #else
41 #define THUNK_GENERATOR(generator)
42 #endif
43 #if ENABLE(DFG_JIT)
44 #define INTRINSIC(intrinsic) , intrinsic
45 #else
46 #define INTRINSIC(intrinsic)
47 #endif
48
49 static const HashTableValue JSDOMMimeTypeTableValues[] =
50 {
51     { "type", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMMimeTypeType), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
52     { "suffixes", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMMimeTypeSuffixes), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53     { "description", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMMimeTypeDescription), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
54     { "enabledPlugin", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMMimeTypeEnabledPlugin), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
55     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMMimeTypeConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
56     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
57 };
58
59 #undef THUNK_GENERATOR
60 static const HashTable JSDOMMimeTypeTable = { 16, 15, JSDOMMimeTypeTableValues, 0 };
61 /* Hash table for constructor */
62 #if ENABLE(JIT)
63 #define THUNK_GENERATOR(generator) , generator
64 #else
65 #define THUNK_GENERATOR(generator)
66 #endif
67 #if ENABLE(DFG_JIT)
68 #define INTRINSIC(intrinsic) , intrinsic
69 #else
70 #define INTRINSIC(intrinsic)
71 #endif
72
73 static const HashTableValue JSDOMMimeTypeConstructorTableValues[] =
74 {
75     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
76 };
77
78 #undef THUNK_GENERATOR
79 static const HashTable JSDOMMimeTypeConstructorTable = { 1, 0, JSDOMMimeTypeConstructorTableValues, 0 };
80 const ClassInfo JSDOMMimeTypeConstructor::s_info = { "MimeTypeConstructor", &DOMConstructorObject::s_info, &JSDOMMimeTypeConstructorTable, 0, CREATE_METHOD_TABLE(JSDOMMimeTypeConstructor) };
81
82 JSDOMMimeTypeConstructor::JSDOMMimeTypeConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
83     : DOMConstructorObject(structure, globalObject)
84 {
85 }
86
87 void JSDOMMimeTypeConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
88 {
89     Base::finishCreation(exec->globalData());
90     ASSERT(inherits(&s_info));
91     putDirect(exec->globalData(), exec->propertyNames().prototype, JSDOMMimeTypePrototype::self(exec, globalObject), DontDelete | ReadOnly);
92 }
93
94 bool JSDOMMimeTypeConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
95 {
96     return getStaticValueSlot<JSDOMMimeTypeConstructor, JSDOMWrapper>(exec, &JSDOMMimeTypeConstructorTable, static_cast<JSDOMMimeTypeConstructor*>(cell), propertyName, slot);
97 }
98
99 bool JSDOMMimeTypeConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
100 {
101     return getStaticValueDescriptor<JSDOMMimeTypeConstructor, JSDOMWrapper>(exec, &JSDOMMimeTypeConstructorTable, static_cast<JSDOMMimeTypeConstructor*>(object), propertyName, descriptor);
102 }
103
104 /* Hash table for prototype */
105 #if ENABLE(JIT)
106 #define THUNK_GENERATOR(generator) , generator
107 #else
108 #define THUNK_GENERATOR(generator)
109 #endif
110 #if ENABLE(DFG_JIT)
111 #define INTRINSIC(intrinsic) , intrinsic
112 #else
113 #define INTRINSIC(intrinsic)
114 #endif
115
116 static const HashTableValue JSDOMMimeTypePrototypeTableValues[] =
117 {
118     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
119 };
120
121 #undef THUNK_GENERATOR
122 static const HashTable JSDOMMimeTypePrototypeTable = { 1, 0, JSDOMMimeTypePrototypeTableValues, 0 };
123 const ClassInfo JSDOMMimeTypePrototype::s_info = { "MimeTypePrototype", &JSC::JSNonFinalObject::s_info, &JSDOMMimeTypePrototypeTable, 0, CREATE_METHOD_TABLE(JSDOMMimeTypePrototype) };
124
125 JSObject* JSDOMMimeTypePrototype::self(ExecState* exec, JSGlobalObject* globalObject)
126 {
127     return getDOMPrototype<JSDOMMimeType>(exec, globalObject);
128 }
129
130 const ClassInfo JSDOMMimeType::s_info = { "MimeType", &JSDOMWrapper::s_info, &JSDOMMimeTypeTable, 0 , CREATE_METHOD_TABLE(JSDOMMimeType) };
131
132 JSDOMMimeType::JSDOMMimeType(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<DOMMimeType> impl)
133     : JSDOMWrapper(structure, globalObject)
134     , m_impl(impl.leakRef())
135 {
136 }
137
138 void JSDOMMimeType::finishCreation(JSGlobalData& globalData)
139 {
140     Base::finishCreation(globalData);
141     ASSERT(inherits(&s_info));
142 }
143
144 JSObject* JSDOMMimeType::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
145 {
146     return JSDOMMimeTypePrototype::create(exec->globalData(), globalObject, JSDOMMimeTypePrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
147 }
148
149 bool JSDOMMimeType::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
150 {
151     JSDOMMimeType* thisObject = jsCast<JSDOMMimeType*>(cell);
152     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
153     return getStaticValueSlot<JSDOMMimeType, Base>(exec, &JSDOMMimeTypeTable, thisObject, propertyName, slot);
154 }
155
156 bool JSDOMMimeType::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
157 {
158     JSDOMMimeType* thisObject = jsCast<JSDOMMimeType*>(object);
159     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
160     return getStaticValueDescriptor<JSDOMMimeType, Base>(exec, &JSDOMMimeTypeTable, thisObject, propertyName, descriptor);
161 }
162
163 JSValue jsDOMMimeTypeType(ExecState* exec, JSValue slotBase, const Identifier&)
164 {
165     JSDOMMimeType* castedThis = static_cast<JSDOMMimeType*>(asObject(slotBase));
166     UNUSED_PARAM(exec);
167     DOMMimeType* imp = static_cast<DOMMimeType*>(castedThis->impl());
168     JSValue result = jsString(exec, imp->type());
169     return result;
170 }
171
172
173 JSValue jsDOMMimeTypeSuffixes(ExecState* exec, JSValue slotBase, const Identifier&)
174 {
175     JSDOMMimeType* castedThis = static_cast<JSDOMMimeType*>(asObject(slotBase));
176     UNUSED_PARAM(exec);
177     DOMMimeType* imp = static_cast<DOMMimeType*>(castedThis->impl());
178     JSValue result = jsString(exec, imp->suffixes());
179     return result;
180 }
181
182
183 JSValue jsDOMMimeTypeDescription(ExecState* exec, JSValue slotBase, const Identifier&)
184 {
185     JSDOMMimeType* castedThis = static_cast<JSDOMMimeType*>(asObject(slotBase));
186     UNUSED_PARAM(exec);
187     DOMMimeType* imp = static_cast<DOMMimeType*>(castedThis->impl());
188     JSValue result = jsString(exec, imp->description());
189     return result;
190 }
191
192
193 JSValue jsDOMMimeTypeEnabledPlugin(ExecState* exec, JSValue slotBase, const Identifier&)
194 {
195     JSDOMMimeType* castedThis = static_cast<JSDOMMimeType*>(asObject(slotBase));
196     UNUSED_PARAM(exec);
197     DOMMimeType* imp = static_cast<DOMMimeType*>(castedThis->impl());
198     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->enabledPlugin()));
199     return result;
200 }
201
202
203 JSValue jsDOMMimeTypeConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
204 {
205     JSDOMMimeType* domObject = static_cast<JSDOMMimeType*>(asObject(slotBase));
206     return JSDOMMimeType::getConstructor(exec, domObject->globalObject());
207 }
208
209 JSValue JSDOMMimeType::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
210 {
211     return getDOMConstructor<JSDOMMimeTypeConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
212 }
213
214 static inline bool isObservable(JSDOMMimeType* jsDOMMimeType)
215 {
216     if (jsDOMMimeType->hasCustomProperties())
217         return true;
218     return false;
219 }
220
221 bool JSDOMMimeTypeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
222 {
223     JSDOMMimeType* jsDOMMimeType = static_cast<JSDOMMimeType*>(handle.get().asCell());
224     if (!isObservable(jsDOMMimeType))
225         return false;
226     UNUSED_PARAM(visitor);
227     return false;
228 }
229
230 void JSDOMMimeTypeOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
231 {
232     JSDOMMimeType* jsDOMMimeType = static_cast<JSDOMMimeType*>(handle.get().asCell());
233     DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
234     uncacheWrapper(world, jsDOMMimeType->impl(), jsDOMMimeType);
235     jsDOMMimeType->releaseImpl();
236 }
237
238 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DOMMimeType* impl)
239 {
240     return wrap<JSDOMMimeType>(exec, globalObject, impl);
241 }
242
243 DOMMimeType* toDOMMimeType(JSC::JSValue value)
244 {
245     return value.inherits(&JSDOMMimeType::s_info) ? static_cast<JSDOMMimeType*>(asObject(value))->impl() : 0;
246 }
247
248 }