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 "JSDOMMimeType.h"
24 #include "DOMMimeType.h"
25 #include "DOMPlugin.h"
26 #include "JSDOMPlugin.h"
28 #include <runtime/JSString.h>
29 #include <wtf/GetPtr.h>
35 ASSERT_CLASS_FITS_IN_CELL(JSDOMMimeType);
39 #define THUNK_GENERATOR(generator) , generator
41 #define THUNK_GENERATOR(generator)
44 #define INTRINSIC(intrinsic) , intrinsic
46 #define INTRINSIC(intrinsic)
49 static const HashTableValue JSDOMMimeTypeTableValues[] =
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) }
59 #undef THUNK_GENERATOR
60 static const HashTable JSDOMMimeTypeTable = { 16, 15, JSDOMMimeTypeTableValues, 0 };
61 /* Hash table for constructor */
63 #define THUNK_GENERATOR(generator) , generator
65 #define THUNK_GENERATOR(generator)
68 #define INTRINSIC(intrinsic) , intrinsic
70 #define INTRINSIC(intrinsic)
73 static const HashTableValue JSDOMMimeTypeConstructorTableValues[] =
75 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
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) };
82 JSDOMMimeTypeConstructor::JSDOMMimeTypeConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
83 : DOMConstructorObject(structure, globalObject)
87 void JSDOMMimeTypeConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
89 Base::finishCreation(exec->globalData());
90 ASSERT(inherits(&s_info));
91 putDirect(exec->globalData(), exec->propertyNames().prototype, JSDOMMimeTypePrototype::self(exec, globalObject), DontDelete | ReadOnly);
94 bool JSDOMMimeTypeConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
96 return getStaticValueSlot<JSDOMMimeTypeConstructor, JSDOMWrapper>(exec, &JSDOMMimeTypeConstructorTable, static_cast<JSDOMMimeTypeConstructor*>(cell), propertyName, slot);
99 bool JSDOMMimeTypeConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
101 return getStaticValueDescriptor<JSDOMMimeTypeConstructor, JSDOMWrapper>(exec, &JSDOMMimeTypeConstructorTable, static_cast<JSDOMMimeTypeConstructor*>(object), propertyName, descriptor);
104 /* Hash table for prototype */
106 #define THUNK_GENERATOR(generator) , generator
108 #define THUNK_GENERATOR(generator)
111 #define INTRINSIC(intrinsic) , intrinsic
113 #define INTRINSIC(intrinsic)
116 static const HashTableValue JSDOMMimeTypePrototypeTableValues[] =
118 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
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) };
125 JSObject* JSDOMMimeTypePrototype::self(ExecState* exec, JSGlobalObject* globalObject)
127 return getDOMPrototype<JSDOMMimeType>(exec, globalObject);
130 const ClassInfo JSDOMMimeType::s_info = { "MimeType", &JSDOMWrapper::s_info, &JSDOMMimeTypeTable, 0 , CREATE_METHOD_TABLE(JSDOMMimeType) };
132 JSDOMMimeType::JSDOMMimeType(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<DOMMimeType> impl)
133 : JSDOMWrapper(structure, globalObject)
134 , m_impl(impl.leakRef())
138 void JSDOMMimeType::finishCreation(JSGlobalData& globalData)
140 Base::finishCreation(globalData);
141 ASSERT(inherits(&s_info));
144 JSObject* JSDOMMimeType::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
146 return JSDOMMimeTypePrototype::create(exec->globalData(), globalObject, JSDOMMimeTypePrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
149 bool JSDOMMimeType::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
151 JSDOMMimeType* thisObject = jsCast<JSDOMMimeType*>(cell);
152 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
153 return getStaticValueSlot<JSDOMMimeType, Base>(exec, &JSDOMMimeTypeTable, thisObject, propertyName, slot);
156 bool JSDOMMimeType::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
158 JSDOMMimeType* thisObject = jsCast<JSDOMMimeType*>(object);
159 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
160 return getStaticValueDescriptor<JSDOMMimeType, Base>(exec, &JSDOMMimeTypeTable, thisObject, propertyName, descriptor);
163 JSValue jsDOMMimeTypeType(ExecState* exec, JSValue slotBase, const Identifier&)
165 JSDOMMimeType* castedThis = static_cast<JSDOMMimeType*>(asObject(slotBase));
167 DOMMimeType* imp = static_cast<DOMMimeType*>(castedThis->impl());
168 JSValue result = jsString(exec, imp->type());
173 JSValue jsDOMMimeTypeSuffixes(ExecState* exec, JSValue slotBase, const Identifier&)
175 JSDOMMimeType* castedThis = static_cast<JSDOMMimeType*>(asObject(slotBase));
177 DOMMimeType* imp = static_cast<DOMMimeType*>(castedThis->impl());
178 JSValue result = jsString(exec, imp->suffixes());
183 JSValue jsDOMMimeTypeDescription(ExecState* exec, JSValue slotBase, const Identifier&)
185 JSDOMMimeType* castedThis = static_cast<JSDOMMimeType*>(asObject(slotBase));
187 DOMMimeType* imp = static_cast<DOMMimeType*>(castedThis->impl());
188 JSValue result = jsString(exec, imp->description());
193 JSValue jsDOMMimeTypeEnabledPlugin(ExecState* exec, JSValue slotBase, const Identifier&)
195 JSDOMMimeType* castedThis = static_cast<JSDOMMimeType*>(asObject(slotBase));
197 DOMMimeType* imp = static_cast<DOMMimeType*>(castedThis->impl());
198 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->enabledPlugin()));
203 JSValue jsDOMMimeTypeConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
205 JSDOMMimeType* domObject = static_cast<JSDOMMimeType*>(asObject(slotBase));
206 return JSDOMMimeType::getConstructor(exec, domObject->globalObject());
209 JSValue JSDOMMimeType::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
211 return getDOMConstructor<JSDOMMimeTypeConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
214 static inline bool isObservable(JSDOMMimeType* jsDOMMimeType)
216 if (jsDOMMimeType->hasCustomProperties())
221 bool JSDOMMimeTypeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
223 JSDOMMimeType* jsDOMMimeType = static_cast<JSDOMMimeType*>(handle.get().asCell());
224 if (!isObservable(jsDOMMimeType))
226 UNUSED_PARAM(visitor);
230 void JSDOMMimeTypeOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
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();
238 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DOMMimeType* impl)
240 return wrap<JSDOMMimeType>(exec, globalObject, impl);
243 DOMMimeType* toDOMMimeType(JSC::JSValue value)
245 return value.inherits(&JSDOMMimeType::s_info) ? static_cast<JSDOMMimeType*>(asObject(value))->impl() : 0;