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.
25 #include "JSHTMLAudioElement.h"
27 #include "ExceptionCode.h"
28 #include "HTMLAudioElement.h"
29 #include "JSDOMBinding.h"
30 #include <runtime/Error.h>
31 #include <wtf/GetPtr.h>
37 ASSERT_CLASS_FITS_IN_CELL(JSHTMLAudioElement);
41 #define THUNK_GENERATOR(generator) , generator
43 #define THUNK_GENERATOR(generator)
46 #define INTRINSIC(intrinsic) , intrinsic
48 #define INTRINSIC(intrinsic)
51 static const HashTableValue JSHTMLAudioElementTableValues[] =
53 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLAudioElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
54 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
57 #undef THUNK_GENERATOR
58 static const HashTable JSHTMLAudioElementTable = { 2, 1, JSHTMLAudioElementTableValues, 0 };
59 /* Hash table for constructor */
61 #define THUNK_GENERATOR(generator) , generator
63 #define THUNK_GENERATOR(generator)
66 #define INTRINSIC(intrinsic) , intrinsic
68 #define INTRINSIC(intrinsic)
71 static const HashTableValue JSHTMLAudioElementConstructorTableValues[] =
73 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
76 #undef THUNK_GENERATOR
77 static const HashTable JSHTMLAudioElementConstructorTable = { 1, 0, JSHTMLAudioElementConstructorTableValues, 0 };
78 const ClassInfo JSHTMLAudioElementConstructor::s_info = { "HTMLAudioElementConstructor", &DOMConstructorObject::s_info, &JSHTMLAudioElementConstructorTable, 0, CREATE_METHOD_TABLE(JSHTMLAudioElementConstructor) };
80 JSHTMLAudioElementConstructor::JSHTMLAudioElementConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
81 : DOMConstructorObject(structure, globalObject)
85 void JSHTMLAudioElementConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
87 Base::finishCreation(exec->globalData());
88 ASSERT(inherits(&s_info));
89 putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLAudioElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
92 bool JSHTMLAudioElementConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
94 return getStaticValueSlot<JSHTMLAudioElementConstructor, JSDOMWrapper>(exec, &JSHTMLAudioElementConstructorTable, static_cast<JSHTMLAudioElementConstructor*>(cell), propertyName, slot);
97 bool JSHTMLAudioElementConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
99 return getStaticValueDescriptor<JSHTMLAudioElementConstructor, JSDOMWrapper>(exec, &JSHTMLAudioElementConstructorTable, static_cast<JSHTMLAudioElementConstructor*>(object), propertyName, descriptor);
102 const ClassInfo JSHTMLAudioElementNamedConstructor::s_info = { "HTMLAudioElementConstructor", &DOMConstructorObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSHTMLAudioElementNamedConstructor) };
104 JSHTMLAudioElementNamedConstructor::JSHTMLAudioElementNamedConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
105 : DOMConstructorWithDocument(structure, globalObject)
109 void JSHTMLAudioElementNamedConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
111 Base::finishCreation(globalObject);
112 ASSERT(inherits(&s_info));
113 putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLAudioElementPrototype::self(exec, globalObject), None);
116 EncodedJSValue JSC_HOST_CALL JSHTMLAudioElementNamedConstructor::constructJSHTMLAudioElement(ExecState* exec)
118 JSHTMLAudioElementNamedConstructor* jsConstructor = static_cast<JSHTMLAudioElementNamedConstructor*>(exec->callee());
119 const String& src(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsEmpty).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, MissingIsEmpty).toString(exec)));
120 if (exec->hadException())
121 return JSValue::encode(jsUndefined());
122 RefPtr<HTMLAudioElement> object = HTMLAudioElement::createForJSConstructor(jsConstructor->document(), src);
123 return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), object.get())));
126 ConstructType JSHTMLAudioElementNamedConstructor::getConstructData(JSCell*, ConstructData& constructData)
128 constructData.native.function = constructJSHTMLAudioElement;
129 return ConstructTypeHost;
132 /* Hash table for prototype */
134 #define THUNK_GENERATOR(generator) , generator
136 #define THUNK_GENERATOR(generator)
139 #define INTRINSIC(intrinsic) , intrinsic
141 #define INTRINSIC(intrinsic)
144 static const HashTableValue JSHTMLAudioElementPrototypeTableValues[] =
146 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
149 #undef THUNK_GENERATOR
150 static const HashTable JSHTMLAudioElementPrototypeTable = { 1, 0, JSHTMLAudioElementPrototypeTableValues, 0 };
151 const ClassInfo JSHTMLAudioElementPrototype::s_info = { "HTMLAudioElementPrototype", &JSC::JSNonFinalObject::s_info, &JSHTMLAudioElementPrototypeTable, 0, CREATE_METHOD_TABLE(JSHTMLAudioElementPrototype) };
153 JSObject* JSHTMLAudioElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
155 return getDOMPrototype<JSHTMLAudioElement>(exec, globalObject);
158 const ClassInfo JSHTMLAudioElement::s_info = { "HTMLAudioElement", &JSHTMLMediaElement::s_info, &JSHTMLAudioElementTable, 0 , CREATE_METHOD_TABLE(JSHTMLAudioElement) };
160 JSHTMLAudioElement::JSHTMLAudioElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLAudioElement> impl)
161 : JSHTMLMediaElement(structure, globalObject, impl)
165 void JSHTMLAudioElement::finishCreation(JSGlobalData& globalData)
167 Base::finishCreation(globalData);
168 ASSERT(inherits(&s_info));
171 JSObject* JSHTMLAudioElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
173 return JSHTMLAudioElementPrototype::create(exec->globalData(), globalObject, JSHTMLAudioElementPrototype::createStructure(exec->globalData(), globalObject, JSHTMLMediaElementPrototype::self(exec, globalObject)));
176 bool JSHTMLAudioElement::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
178 JSHTMLAudioElement* thisObject = jsCast<JSHTMLAudioElement*>(cell);
179 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
180 return getStaticValueSlot<JSHTMLAudioElement, Base>(exec, &JSHTMLAudioElementTable, thisObject, propertyName, slot);
183 bool JSHTMLAudioElement::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
185 JSHTMLAudioElement* thisObject = jsCast<JSHTMLAudioElement*>(object);
186 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
187 return getStaticValueDescriptor<JSHTMLAudioElement, Base>(exec, &JSHTMLAudioElementTable, thisObject, propertyName, descriptor);
190 JSValue jsHTMLAudioElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
192 JSHTMLAudioElement* domObject = static_cast<JSHTMLAudioElement*>(asObject(slotBase));
193 return JSHTMLAudioElement::getConstructor(exec, domObject->globalObject());
196 JSValue JSHTMLAudioElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
198 return getDOMConstructor<JSHTMLAudioElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
201 static inline bool isObservable(JSHTMLAudioElement* jsHTMLAudioElement)
203 if (jsHTMLAudioElement->hasCustomProperties())
208 bool JSHTMLAudioElementOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
210 JSHTMLAudioElement* jsHTMLAudioElement = static_cast<JSHTMLAudioElement*>(handle.get().asCell());
211 if (jsHTMLAudioElement->impl()->hasPendingActivity())
213 if (!isObservable(jsHTMLAudioElement))
215 UNUSED_PARAM(visitor);
219 void JSHTMLAudioElementOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
221 JSHTMLAudioElement* jsHTMLAudioElement = static_cast<JSHTMLAudioElement*>(handle.get().asCell());
222 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
223 uncacheWrapper(world, jsHTMLAudioElement->impl(), jsHTMLAudioElement);
224 jsHTMLAudioElement->releaseImpl();
230 #endif // ENABLE(VIDEO)