|
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 "JSBeforeLoadEvent.h" |
|
23 |
|
24 #include "BeforeLoadEvent.h" |
|
25 #include "KURL.h" |
|
26 #include <runtime/Error.h> |
|
27 #include <runtime/JSString.h> |
|
28 #include <wtf/GetPtr.h> |
|
29 |
|
30 using namespace JSC; |
|
31 |
|
32 namespace WebCore { |
|
33 |
|
34 ASSERT_CLASS_FITS_IN_CELL(JSBeforeLoadEvent); |
|
35 |
|
36 /* Hash table */ |
|
37 #if ENABLE(JIT) |
|
38 #define THUNK_GENERATOR(generator) , generator |
|
39 #else |
|
40 #define THUNK_GENERATOR(generator) |
|
41 #endif |
|
42 |
|
43 static const HashTableValue JSBeforeLoadEventTableValues[3] = |
|
44 { |
|
45 { "url", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsBeforeLoadEventUrl), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
46 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsBeforeLoadEventConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
47 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
48 }; |
|
49 |
|
50 #undef THUNK_GENERATOR |
|
51 static JSC_CONST_HASHTABLE HashTable JSBeforeLoadEventTable = { 4, 3, JSBeforeLoadEventTableValues, 0 }; |
|
52 /* Hash table for constructor */ |
|
53 #if ENABLE(JIT) |
|
54 #define THUNK_GENERATOR(generator) , generator |
|
55 #else |
|
56 #define THUNK_GENERATOR(generator) |
|
57 #endif |
|
58 |
|
59 static const HashTableValue JSBeforeLoadEventConstructorTableValues[1] = |
|
60 { |
|
61 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
62 }; |
|
63 |
|
64 #undef THUNK_GENERATOR |
|
65 static JSC_CONST_HASHTABLE HashTable JSBeforeLoadEventConstructorTable = { 1, 0, JSBeforeLoadEventConstructorTableValues, 0 }; |
|
66 class JSBeforeLoadEventConstructor : public DOMConstructorObject { |
|
67 public: |
|
68 JSBeforeLoadEventConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
69 |
|
70 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
71 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
72 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
73 static const JSC::ClassInfo s_info; |
|
74 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
75 { |
|
76 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
77 } |
|
78 protected: |
|
79 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
80 }; |
|
81 |
|
82 const ClassInfo JSBeforeLoadEventConstructor::s_info = { "BeforeLoadEventConstructor", 0, &JSBeforeLoadEventConstructorTable, 0 }; |
|
83 |
|
84 JSBeforeLoadEventConstructor::JSBeforeLoadEventConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
85 : DOMConstructorObject(JSBeforeLoadEventConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
86 { |
|
87 putDirect(exec->propertyNames().prototype, JSBeforeLoadEventPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
88 } |
|
89 |
|
90 bool JSBeforeLoadEventConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
91 { |
|
92 return getStaticValueSlot<JSBeforeLoadEventConstructor, DOMObject>(exec, &JSBeforeLoadEventConstructorTable, this, propertyName, slot); |
|
93 } |
|
94 |
|
95 bool JSBeforeLoadEventConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
96 { |
|
97 return getStaticValueDescriptor<JSBeforeLoadEventConstructor, DOMObject>(exec, &JSBeforeLoadEventConstructorTable, this, propertyName, descriptor); |
|
98 } |
|
99 |
|
100 /* Hash table for prototype */ |
|
101 #if ENABLE(JIT) |
|
102 #define THUNK_GENERATOR(generator) , generator |
|
103 #else |
|
104 #define THUNK_GENERATOR(generator) |
|
105 #endif |
|
106 |
|
107 static const HashTableValue JSBeforeLoadEventPrototypeTableValues[2] = |
|
108 { |
|
109 { "initBeforeLoadEvent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsBeforeLoadEventPrototypeFunctionInitBeforeLoadEvent), (intptr_t)4 THUNK_GENERATOR(0) }, |
|
110 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
111 }; |
|
112 |
|
113 #undef THUNK_GENERATOR |
|
114 static JSC_CONST_HASHTABLE HashTable JSBeforeLoadEventPrototypeTable = { 2, 1, JSBeforeLoadEventPrototypeTableValues, 0 }; |
|
115 const ClassInfo JSBeforeLoadEventPrototype::s_info = { "BeforeLoadEventPrototype", 0, &JSBeforeLoadEventPrototypeTable, 0 }; |
|
116 |
|
117 JSObject* JSBeforeLoadEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
118 { |
|
119 return getDOMPrototype<JSBeforeLoadEvent>(exec, globalObject); |
|
120 } |
|
121 |
|
122 bool JSBeforeLoadEventPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
123 { |
|
124 return getStaticFunctionSlot<JSObject>(exec, &JSBeforeLoadEventPrototypeTable, this, propertyName, slot); |
|
125 } |
|
126 |
|
127 bool JSBeforeLoadEventPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
128 { |
|
129 return getStaticFunctionDescriptor<JSObject>(exec, &JSBeforeLoadEventPrototypeTable, this, propertyName, descriptor); |
|
130 } |
|
131 |
|
132 const ClassInfo JSBeforeLoadEvent::s_info = { "BeforeLoadEvent", &JSEvent::s_info, &JSBeforeLoadEventTable, 0 }; |
|
133 |
|
134 JSBeforeLoadEvent::JSBeforeLoadEvent(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<BeforeLoadEvent> impl) |
|
135 : JSEvent(structure, globalObject, impl) |
|
136 { |
|
137 } |
|
138 |
|
139 JSObject* JSBeforeLoadEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
140 { |
|
141 return new (exec) JSBeforeLoadEventPrototype(globalObject, JSBeforeLoadEventPrototype::createStructure(JSEventPrototype::self(exec, globalObject))); |
|
142 } |
|
143 |
|
144 bool JSBeforeLoadEvent::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
145 { |
|
146 return getStaticValueSlot<JSBeforeLoadEvent, Base>(exec, &JSBeforeLoadEventTable, this, propertyName, slot); |
|
147 } |
|
148 |
|
149 bool JSBeforeLoadEvent::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
150 { |
|
151 return getStaticValueDescriptor<JSBeforeLoadEvent, Base>(exec, &JSBeforeLoadEventTable, this, propertyName, descriptor); |
|
152 } |
|
153 |
|
154 JSValue jsBeforeLoadEventUrl(ExecState* exec, JSValue slotBase, const Identifier&) |
|
155 { |
|
156 JSBeforeLoadEvent* castedThis = static_cast<JSBeforeLoadEvent*>(asObject(slotBase)); |
|
157 UNUSED_PARAM(exec); |
|
158 BeforeLoadEvent* imp = static_cast<BeforeLoadEvent*>(castedThis->impl()); |
|
159 JSValue result = jsString(exec, imp->url()); |
|
160 return result; |
|
161 } |
|
162 |
|
163 JSValue jsBeforeLoadEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
164 { |
|
165 JSBeforeLoadEvent* domObject = static_cast<JSBeforeLoadEvent*>(asObject(slotBase)); |
|
166 return JSBeforeLoadEvent::getConstructor(exec, domObject->globalObject()); |
|
167 } |
|
168 JSValue JSBeforeLoadEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
169 { |
|
170 return getDOMConstructor<JSBeforeLoadEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
171 } |
|
172 |
|
173 EncodedJSValue JSC_HOST_CALL jsBeforeLoadEventPrototypeFunctionInitBeforeLoadEvent(ExecState* exec) |
|
174 { |
|
175 JSValue thisValue = exec->hostThisValue(); |
|
176 if (!thisValue.inherits(&JSBeforeLoadEvent::s_info)) |
|
177 return throwVMTypeError(exec); |
|
178 JSBeforeLoadEvent* castedThis = static_cast<JSBeforeLoadEvent*>(asObject(thisValue)); |
|
179 BeforeLoadEvent* imp = static_cast<BeforeLoadEvent*>(castedThis->impl()); |
|
180 const String& type = ustringToString(exec->argument(0).toString(exec)); |
|
181 bool canBubble = exec->argument(1).toBoolean(exec); |
|
182 bool cancelable = exec->argument(2).toBoolean(exec); |
|
183 const String& url = ustringToString(exec->argument(3).toString(exec)); |
|
184 |
|
185 imp->initBeforeLoadEvent(type, canBubble, cancelable, url); |
|
186 return JSValue::encode(jsUndefined()); |
|
187 } |
|
188 |
|
189 |
|
190 } |