|
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 "JSVoidCallback.h" |
|
23 |
|
24 #include "VoidCallback.h" |
|
25 #include <runtime/Error.h> |
|
26 #include <wtf/GetPtr.h> |
|
27 |
|
28 using namespace JSC; |
|
29 |
|
30 namespace WebCore { |
|
31 |
|
32 ASSERT_CLASS_FITS_IN_CELL(JSVoidCallback); |
|
33 |
|
34 /* Hash table for prototype */ |
|
35 #if ENABLE(JIT) |
|
36 #define THUNK_GENERATOR(generator) , generator |
|
37 #else |
|
38 #define THUNK_GENERATOR(generator) |
|
39 #endif |
|
40 |
|
41 static const HashTableValue JSVoidCallbackPrototypeTableValues[2] = |
|
42 { |
|
43 { "handleEvent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsVoidCallbackPrototypeFunctionHandleEvent), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
44 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
45 }; |
|
46 |
|
47 #undef THUNK_GENERATOR |
|
48 static JSC_CONST_HASHTABLE HashTable JSVoidCallbackPrototypeTable = { 2, 1, JSVoidCallbackPrototypeTableValues, 0 }; |
|
49 const ClassInfo JSVoidCallbackPrototype::s_info = { "VoidCallbackPrototype", 0, &JSVoidCallbackPrototypeTable, 0 }; |
|
50 |
|
51 JSObject* JSVoidCallbackPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
52 { |
|
53 return getDOMPrototype<JSVoidCallback>(exec, globalObject); |
|
54 } |
|
55 |
|
56 bool JSVoidCallbackPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
57 { |
|
58 return getStaticFunctionSlot<JSObject>(exec, &JSVoidCallbackPrototypeTable, this, propertyName, slot); |
|
59 } |
|
60 |
|
61 bool JSVoidCallbackPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
62 { |
|
63 return getStaticFunctionDescriptor<JSObject>(exec, &JSVoidCallbackPrototypeTable, this, propertyName, descriptor); |
|
64 } |
|
65 |
|
66 const ClassInfo JSVoidCallback::s_info = { "VoidCallback", 0, 0, 0 }; |
|
67 |
|
68 JSVoidCallback::JSVoidCallback(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<VoidCallback> impl) |
|
69 : DOMObjectWithGlobalPointer(structure, globalObject) |
|
70 , m_impl(impl) |
|
71 { |
|
72 } |
|
73 |
|
74 JSVoidCallback::~JSVoidCallback() |
|
75 { |
|
76 forgetDOMObject(this, impl()); |
|
77 } |
|
78 |
|
79 JSObject* JSVoidCallback::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
80 { |
|
81 return new (exec) JSVoidCallbackPrototype(globalObject, JSVoidCallbackPrototype::createStructure(globalObject->objectPrototype())); |
|
82 } |
|
83 |
|
84 EncodedJSValue JSC_HOST_CALL jsVoidCallbackPrototypeFunctionHandleEvent(ExecState* exec) |
|
85 { |
|
86 JSValue thisValue = exec->hostThisValue(); |
|
87 if (!thisValue.inherits(&JSVoidCallback::s_info)) |
|
88 return throwVMTypeError(exec); |
|
89 JSVoidCallback* castedThis = static_cast<JSVoidCallback*>(asObject(thisValue)); |
|
90 VoidCallback* imp = static_cast<VoidCallback*>(castedThis->impl()); |
|
91 |
|
92 imp->handleEvent(); |
|
93 return JSValue::encode(jsUndefined()); |
|
94 } |
|
95 |
|
96 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, VoidCallback* object) |
|
97 { |
|
98 return getDOMObjectWrapper<JSVoidCallback>(exec, globalObject, object); |
|
99 } |
|
100 |
|
101 } |