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 "JSTestMediaQueryListListener.h"
24 #include "ExceptionCode.h"
25 #include "JSDOMBinding.h"
26 #include "JSMediaQueryListListener.h"
27 #include "TestMediaQueryListListener.h"
28 #include <runtime/Error.h>
29 #include <wtf/GetPtr.h>
37 static const HashTableValue JSTestMediaQueryListListenerTableValues[] =
39 { "constructor", DontEnum | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestMediaQueryListListenerConstructor), (intptr_t)0 },
40 { 0, 0, NoIntrinsic, 0, 0 }
43 static const HashTable JSTestMediaQueryListListenerTable = { 2, 1, JSTestMediaQueryListListenerTableValues, 0 };
44 /* Hash table for constructor */
46 static const HashTableValue JSTestMediaQueryListListenerConstructorTableValues[] =
48 { 0, 0, NoIntrinsic, 0, 0 }
51 static const HashTable JSTestMediaQueryListListenerConstructorTable = { 1, 0, JSTestMediaQueryListListenerConstructorTableValues, 0 };
52 const ClassInfo JSTestMediaQueryListListenerConstructor::s_info = { "TestMediaQueryListListenerConstructor", &Base::s_info, &JSTestMediaQueryListListenerConstructorTable, 0, CREATE_METHOD_TABLE(JSTestMediaQueryListListenerConstructor) };
54 JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
55 : DOMConstructorObject(structure, globalObject)
59 void JSTestMediaQueryListListenerConstructor::finishCreation(VM& vm, JSDOMGlobalObject* globalObject)
61 Base::finishCreation(vm);
62 ASSERT(inherits(info()));
63 putDirect(vm, vm.propertyNames->prototype, JSTestMediaQueryListListenerPrototype::self(vm, globalObject), DontDelete | ReadOnly);
64 putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum);
67 bool JSTestMediaQueryListListenerConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
69 return getStaticValueSlot<JSTestMediaQueryListListenerConstructor, JSDOMWrapper>(exec, JSTestMediaQueryListListenerConstructorTable, jsCast<JSTestMediaQueryListListenerConstructor*>(object), propertyName, slot);
72 /* Hash table for prototype */
74 static const HashTableValue JSTestMediaQueryListListenerPrototypeTableValues[] =
76 { "method", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestMediaQueryListListenerPrototypeFunctionMethod), (intptr_t)1 },
77 { 0, 0, NoIntrinsic, 0, 0 }
80 static const HashTable JSTestMediaQueryListListenerPrototypeTable = { 2, 1, JSTestMediaQueryListListenerPrototypeTableValues, 0 };
81 const ClassInfo JSTestMediaQueryListListenerPrototype::s_info = { "TestMediaQueryListListenerPrototype", &Base::s_info, &JSTestMediaQueryListListenerPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestMediaQueryListListenerPrototype) };
83 JSObject* JSTestMediaQueryListListenerPrototype::self(VM& vm, JSGlobalObject* globalObject)
85 return getDOMPrototype<JSTestMediaQueryListListener>(vm, globalObject);
88 bool JSTestMediaQueryListListenerPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
90 JSTestMediaQueryListListenerPrototype* thisObject = jsCast<JSTestMediaQueryListListenerPrototype*>(object);
91 return getStaticFunctionSlot<JSObject>(exec, JSTestMediaQueryListListenerPrototypeTable, thisObject, propertyName, slot);
94 const ClassInfo JSTestMediaQueryListListener::s_info = { "TestMediaQueryListListener", &Base::s_info, &JSTestMediaQueryListListenerTable, 0 , CREATE_METHOD_TABLE(JSTestMediaQueryListListener) };
96 JSTestMediaQueryListListener::JSTestMediaQueryListListener(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestMediaQueryListListener> impl)
97 : JSDOMWrapper(structure, globalObject)
98 , m_impl(impl.leakRef())
102 void JSTestMediaQueryListListener::finishCreation(VM& vm)
104 Base::finishCreation(vm);
105 ASSERT(inherits(info()));
108 JSObject* JSTestMediaQueryListListener::createPrototype(VM& vm, JSGlobalObject* globalObject)
110 return JSTestMediaQueryListListenerPrototype::create(vm, globalObject, JSTestMediaQueryListListenerPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
113 void JSTestMediaQueryListListener::destroy(JSC::JSCell* cell)
115 JSTestMediaQueryListListener* thisObject = static_cast<JSTestMediaQueryListListener*>(cell);
116 thisObject->JSTestMediaQueryListListener::~JSTestMediaQueryListListener();
119 JSTestMediaQueryListListener::~JSTestMediaQueryListListener()
121 releaseImplIfNotNull();
124 bool JSTestMediaQueryListListener::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
126 JSTestMediaQueryListListener* thisObject = jsCast<JSTestMediaQueryListListener*>(object);
127 ASSERT_GC_OBJECT_INHERITS(thisObject, info());
128 return getStaticValueSlot<JSTestMediaQueryListListener, Base>(exec, JSTestMediaQueryListListenerTable, thisObject, propertyName, slot);
131 JSValue jsTestMediaQueryListListenerConstructor(ExecState* exec, JSValue slotBase, PropertyName)
133 JSTestMediaQueryListListener* domObject = jsCast<JSTestMediaQueryListListener*>(asObject(slotBase));
134 return JSTestMediaQueryListListener::getConstructor(exec->vm(), domObject->globalObject());
137 JSValue JSTestMediaQueryListListener::getConstructor(VM& vm, JSGlobalObject* globalObject)
139 return getDOMConstructor<JSTestMediaQueryListListenerConstructor>(vm, jsCast<JSDOMGlobalObject*>(globalObject));
142 EncodedJSValue JSC_HOST_CALL jsTestMediaQueryListListenerPrototypeFunctionMethod(ExecState* exec)
144 JSValue thisValue = exec->hostThisValue();
145 if (!thisValue.inherits(JSTestMediaQueryListListener::info()))
146 return throwVMTypeError(exec);
147 JSTestMediaQueryListListener* castedThis = jsCast<JSTestMediaQueryListListener*>(asObject(thisValue));
148 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestMediaQueryListListener::info());
149 TestMediaQueryListListener& impl = castedThis->impl();
150 if (exec->argumentCount() < 1)
151 return throwVMError(exec, createNotEnoughArgumentsError(exec));
152 if (!exec->argument(0).isFunction())
153 return throwVMTypeError(exec);
154 RefPtr<MediaQueryListListener> listener = JSMediaQueryListListener::create(asObject(exec->uncheckedArgument(0)), castedThis->globalObject());
155 impl.method(listener);
156 return JSValue::encode(jsUndefined());
159 bool JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
161 UNUSED_PARAM(handle);
162 UNUSED_PARAM(visitor);
166 void JSTestMediaQueryListListenerOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
168 JSTestMediaQueryListListener* jsTestMediaQueryListListener = jsCast<JSTestMediaQueryListListener*>(handle.get().asCell());
169 DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
170 uncacheWrapper(world, &jsTestMediaQueryListListener->impl(), jsTestMediaQueryListListener);
171 jsTestMediaQueryListListener->releaseImpl();
174 #if ENABLE(BINDING_INTEGRITY)
176 #pragma warning(disable: 4483)
177 extern "C" { extern void (*const __identifier("??_7TestMediaQueryListListener@WebCore@@6B@")[])(); }
179 extern "C" { extern void* _ZTVN7WebCore26TestMediaQueryListListenerE[]; }
182 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestMediaQueryListListener* impl)
186 if (JSValue result = getExistingWrapper<JSTestMediaQueryListListener>(exec, impl))
189 #if ENABLE(BINDING_INTEGRITY)
190 void* actualVTablePointer = *(reinterpret_cast<void**>(impl));
192 void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestMediaQueryListListener@WebCore@@6B@"));
194 void* expectedVTablePointer = &_ZTVN7WebCore26TestMediaQueryListListenerE[2];
196 // If this fails TestMediaQueryListListener does not have a vtable, so you need to add the
197 // ImplementationLacksVTable attribute to the interface definition
198 COMPILE_ASSERT(__is_polymorphic(TestMediaQueryListListener), TestMediaQueryListListener_is_not_polymorphic);
201 // If you hit this assertion you either have a use after free bug, or
202 // TestMediaQueryListListener has subclasses. If TestMediaQueryListListener has subclasses that get passed
203 // to toJS() we currently require TestMediaQueryListListener you to opt out of binding hardening
204 // by adding the SkipVTableValidation attribute to the interface IDL definition
205 RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
207 ReportMemoryCost<TestMediaQueryListListener>::reportMemoryCost(exec, impl);
208 return createNewWrapper<JSTestMediaQueryListListener>(exec, globalObject, impl);
211 TestMediaQueryListListener* toTestMediaQueryListListener(JSC::JSValue value)
213 return value.inherits(JSTestMediaQueryListListener::info()) ? &jsCast<JSTestMediaQueryListListener*>(asObject(value))->impl() : 0;