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 "JSVoidCallback.h"
24 #include "ExceptionCode.h"
25 #include "JSDOMBinding.h"
26 #include "VoidCallback.h"
27 #include <runtime/Error.h>
28 #include <wtf/GetPtr.h>
34 ASSERT_CLASS_FITS_IN_CELL(JSVoidCallback);
36 /* Hash table for prototype */
38 #define THUNK_GENERATOR(generator) , generator
40 #define THUNK_GENERATOR(generator)
43 #define INTRINSIC(intrinsic) , intrinsic
45 #define INTRINSIC(intrinsic)
48 static const HashTableValue JSVoidCallbackPrototypeTableValues[] =
50 { "handleEvent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsVoidCallbackPrototypeFunctionHandleEvent), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
51 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
54 #undef THUNK_GENERATOR
55 static const HashTable JSVoidCallbackPrototypeTable = { 2, 1, JSVoidCallbackPrototypeTableValues, 0 };
56 const ClassInfo JSVoidCallbackPrototype::s_info = { "VoidCallbackPrototype", &JSC::JSNonFinalObject::s_info, &JSVoidCallbackPrototypeTable, 0, CREATE_METHOD_TABLE(JSVoidCallbackPrototype) };
58 JSObject* JSVoidCallbackPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
60 return getDOMPrototype<JSVoidCallback>(exec, globalObject);
63 bool JSVoidCallbackPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
65 JSVoidCallbackPrototype* thisObject = jsCast<JSVoidCallbackPrototype*>(cell);
66 return getStaticFunctionSlot<JSObject>(exec, &JSVoidCallbackPrototypeTable, thisObject, propertyName, slot);
69 bool JSVoidCallbackPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
71 JSVoidCallbackPrototype* thisObject = jsCast<JSVoidCallbackPrototype*>(object);
72 return getStaticFunctionDescriptor<JSObject>(exec, &JSVoidCallbackPrototypeTable, thisObject, propertyName, descriptor);
75 const ClassInfo JSVoidCallback::s_info = { "VoidCallback", &JSDOMWrapper::s_info, 0, 0 , CREATE_METHOD_TABLE(JSVoidCallback) };
77 JSVoidCallback::JSVoidCallback(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<VoidCallback> impl)
78 : JSDOMWrapper(structure, globalObject)
79 , m_impl(impl.leakRef())
83 void JSVoidCallback::finishCreation(JSGlobalData& globalData)
85 Base::finishCreation(globalData);
86 ASSERT(inherits(&s_info));
89 JSObject* JSVoidCallback::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
91 return JSVoidCallbackPrototype::create(exec->globalData(), globalObject, JSVoidCallbackPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
94 EncodedJSValue JSC_HOST_CALL jsVoidCallbackPrototypeFunctionHandleEvent(ExecState* exec)
96 JSValue thisValue = exec->hostThisValue();
97 if (!thisValue.inherits(&JSVoidCallback::s_info))
98 return throwVMTypeError(exec);
99 JSVoidCallback* castedThis = static_cast<JSVoidCallback*>(asObject(thisValue));
100 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSVoidCallback::s_info);
101 VoidCallback* imp = static_cast<VoidCallback*>(castedThis->impl());
103 return JSValue::encode(jsUndefined());
106 static inline bool isObservable(JSVoidCallback* jsVoidCallback)
108 if (jsVoidCallback->hasCustomProperties())
113 bool JSVoidCallbackOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
115 JSVoidCallback* jsVoidCallback = static_cast<JSVoidCallback*>(handle.get().asCell());
116 if (!isObservable(jsVoidCallback))
118 UNUSED_PARAM(visitor);
122 void JSVoidCallbackOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
124 JSVoidCallback* jsVoidCallback = static_cast<JSVoidCallback*>(handle.get().asCell());
125 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
126 uncacheWrapper(world, jsVoidCallback->impl(), jsVoidCallback);
127 jsVoidCallback->releaseImpl();
130 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, VoidCallback* impl)
132 return wrap<JSVoidCallback>(exec, globalObject, impl);