|
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 |
|
23 #if ENABLE(GEOLOCATION) |
|
24 |
|
25 #include "JSPositionError.h" |
|
26 |
|
27 #include "KURL.h" |
|
28 #include "PositionError.h" |
|
29 #include <runtime/JSNumberCell.h> |
|
30 #include <runtime/JSString.h> |
|
31 #include <wtf/GetPtr.h> |
|
32 |
|
33 using namespace JSC; |
|
34 |
|
35 namespace WebCore { |
|
36 |
|
37 ASSERT_CLASS_FITS_IN_CELL(JSPositionError); |
|
38 |
|
39 /* Hash table */ |
|
40 #if ENABLE(JIT) |
|
41 #define THUNK_GENERATOR(generator) , generator |
|
42 #else |
|
43 #define THUNK_GENERATOR(generator) |
|
44 #endif |
|
45 |
|
46 static const HashTableValue JSPositionErrorTableValues[4] = |
|
47 { |
|
48 { "code", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorCode), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
49 { "message", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorMessage), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
50 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
51 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
52 }; |
|
53 |
|
54 #undef THUNK_GENERATOR |
|
55 static JSC_CONST_HASHTABLE HashTable JSPositionErrorTable = { 9, 7, JSPositionErrorTableValues, 0 }; |
|
56 /* Hash table for constructor */ |
|
57 #if ENABLE(JIT) |
|
58 #define THUNK_GENERATOR(generator) , generator |
|
59 #else |
|
60 #define THUNK_GENERATOR(generator) |
|
61 #endif |
|
62 |
|
63 static const HashTableValue JSPositionErrorConstructorTableValues[4] = |
|
64 { |
|
65 { "PERMISSION_DENIED", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorPERMISSION_DENIED), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
66 { "POSITION_UNAVAILABLE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorPOSITION_UNAVAILABLE), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
67 { "TIMEOUT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorTIMEOUT), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
68 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
69 }; |
|
70 |
|
71 #undef THUNK_GENERATOR |
|
72 static JSC_CONST_HASHTABLE HashTable JSPositionErrorConstructorTable = { 9, 7, JSPositionErrorConstructorTableValues, 0 }; |
|
73 |
|
74 COMPILE_ASSERT(1 == PositionError::PERMISSION_DENIED, PositionErrorEnumPERMISSION_DENIEDIsWrongUseDontCheckEnums); |
|
75 COMPILE_ASSERT(2 == PositionError::POSITION_UNAVAILABLE, PositionErrorEnumPOSITION_UNAVAILABLEIsWrongUseDontCheckEnums); |
|
76 COMPILE_ASSERT(3 == PositionError::TIMEOUT, PositionErrorEnumTIMEOUTIsWrongUseDontCheckEnums); |
|
77 |
|
78 class JSPositionErrorConstructor : public DOMConstructorObject { |
|
79 public: |
|
80 JSPositionErrorConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
81 |
|
82 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
83 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
84 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
85 static const JSC::ClassInfo s_info; |
|
86 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
87 { |
|
88 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
89 } |
|
90 protected: |
|
91 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
92 }; |
|
93 |
|
94 const ClassInfo JSPositionErrorConstructor::s_info = { "PositionErrorConstructor", 0, &JSPositionErrorConstructorTable, 0 }; |
|
95 |
|
96 JSPositionErrorConstructor::JSPositionErrorConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
97 : DOMConstructorObject(JSPositionErrorConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
98 { |
|
99 putDirect(exec->propertyNames().prototype, JSPositionErrorPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
100 } |
|
101 |
|
102 bool JSPositionErrorConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
103 { |
|
104 return getStaticValueSlot<JSPositionErrorConstructor, DOMObject>(exec, &JSPositionErrorConstructorTable, this, propertyName, slot); |
|
105 } |
|
106 |
|
107 bool JSPositionErrorConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
108 { |
|
109 return getStaticValueDescriptor<JSPositionErrorConstructor, DOMObject>(exec, &JSPositionErrorConstructorTable, this, propertyName, descriptor); |
|
110 } |
|
111 |
|
112 /* Hash table for prototype */ |
|
113 #if ENABLE(JIT) |
|
114 #define THUNK_GENERATOR(generator) , generator |
|
115 #else |
|
116 #define THUNK_GENERATOR(generator) |
|
117 #endif |
|
118 |
|
119 static const HashTableValue JSPositionErrorPrototypeTableValues[4] = |
|
120 { |
|
121 { "PERMISSION_DENIED", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorPERMISSION_DENIED), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
122 { "POSITION_UNAVAILABLE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorPOSITION_UNAVAILABLE), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
123 { "TIMEOUT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorTIMEOUT), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
124 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
125 }; |
|
126 |
|
127 #undef THUNK_GENERATOR |
|
128 static JSC_CONST_HASHTABLE HashTable JSPositionErrorPrototypeTable = { 9, 7, JSPositionErrorPrototypeTableValues, 0 }; |
|
129 const ClassInfo JSPositionErrorPrototype::s_info = { "PositionErrorPrototype", 0, &JSPositionErrorPrototypeTable, 0 }; |
|
130 |
|
131 JSObject* JSPositionErrorPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
132 { |
|
133 return getDOMPrototype<JSPositionError>(exec, globalObject); |
|
134 } |
|
135 |
|
136 bool JSPositionErrorPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
137 { |
|
138 return getStaticValueSlot<JSPositionErrorPrototype, JSObject>(exec, &JSPositionErrorPrototypeTable, this, propertyName, slot); |
|
139 } |
|
140 |
|
141 bool JSPositionErrorPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
142 { |
|
143 return getStaticValueDescriptor<JSPositionErrorPrototype, JSObject>(exec, &JSPositionErrorPrototypeTable, this, propertyName, descriptor); |
|
144 } |
|
145 |
|
146 const ClassInfo JSPositionError::s_info = { "PositionError", 0, &JSPositionErrorTable, 0 }; |
|
147 |
|
148 JSPositionError::JSPositionError(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<PositionError> impl) |
|
149 : DOMObjectWithGlobalPointer(structure, globalObject) |
|
150 , m_impl(impl) |
|
151 { |
|
152 } |
|
153 |
|
154 JSPositionError::~JSPositionError() |
|
155 { |
|
156 forgetDOMObject(this, impl()); |
|
157 } |
|
158 |
|
159 JSObject* JSPositionError::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
160 { |
|
161 return new (exec) JSPositionErrorPrototype(globalObject, JSPositionErrorPrototype::createStructure(globalObject->objectPrototype())); |
|
162 } |
|
163 |
|
164 bool JSPositionError::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
165 { |
|
166 return getStaticValueSlot<JSPositionError, Base>(exec, &JSPositionErrorTable, this, propertyName, slot); |
|
167 } |
|
168 |
|
169 bool JSPositionError::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
170 { |
|
171 return getStaticValueDescriptor<JSPositionError, Base>(exec, &JSPositionErrorTable, this, propertyName, descriptor); |
|
172 } |
|
173 |
|
174 JSValue jsPositionErrorCode(ExecState* exec, JSValue slotBase, const Identifier&) |
|
175 { |
|
176 JSPositionError* castedThis = static_cast<JSPositionError*>(asObject(slotBase)); |
|
177 UNUSED_PARAM(exec); |
|
178 PositionError* imp = static_cast<PositionError*>(castedThis->impl()); |
|
179 JSValue result = jsNumber(exec, imp->code()); |
|
180 return result; |
|
181 } |
|
182 |
|
183 JSValue jsPositionErrorMessage(ExecState* exec, JSValue slotBase, const Identifier&) |
|
184 { |
|
185 JSPositionError* castedThis = static_cast<JSPositionError*>(asObject(slotBase)); |
|
186 UNUSED_PARAM(exec); |
|
187 PositionError* imp = static_cast<PositionError*>(castedThis->impl()); |
|
188 JSValue result = jsString(exec, imp->message()); |
|
189 return result; |
|
190 } |
|
191 |
|
192 JSValue jsPositionErrorConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
193 { |
|
194 JSPositionError* domObject = static_cast<JSPositionError*>(asObject(slotBase)); |
|
195 return JSPositionError::getConstructor(exec, domObject->globalObject()); |
|
196 } |
|
197 JSValue JSPositionError::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
198 { |
|
199 return getDOMConstructor<JSPositionErrorConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
200 } |
|
201 |
|
202 // Constant getters |
|
203 |
|
204 JSValue jsPositionErrorPERMISSION_DENIED(ExecState* exec, JSValue, const Identifier&) |
|
205 { |
|
206 return jsNumber(exec, static_cast<int>(1)); |
|
207 } |
|
208 |
|
209 JSValue jsPositionErrorPOSITION_UNAVAILABLE(ExecState* exec, JSValue, const Identifier&) |
|
210 { |
|
211 return jsNumber(exec, static_cast<int>(2)); |
|
212 } |
|
213 |
|
214 JSValue jsPositionErrorTIMEOUT(ExecState* exec, JSValue, const Identifier&) |
|
215 { |
|
216 return jsNumber(exec, static_cast<int>(3)); |
|
217 } |
|
218 |
|
219 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, PositionError* object) |
|
220 { |
|
221 return getDOMObjectWrapper<JSPositionError>(exec, globalObject, object); |
|
222 } |
|
223 PositionError* toPositionError(JSC::JSValue value) |
|
224 { |
|
225 return value.inherits(&JSPositionError::s_info) ? static_cast<JSPositionError*>(asObject(value))->impl() : 0; |
|
226 } |
|
227 |
|
228 } |
|
229 |
|
230 #endif // ENABLE(GEOLOCATION) |