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.
23 #if ENABLE(GEOLOCATION)
25 #include "JSPositionError.h"
28 #include "PositionError.h"
29 #include <runtime/JSString.h>
30 #include <wtf/GetPtr.h>
36 ASSERT_CLASS_FITS_IN_CELL(JSPositionError);
40 #define THUNK_GENERATOR(generator) , generator
42 #define THUNK_GENERATOR(generator)
45 #define INTRINSIC(intrinsic) , intrinsic
47 #define INTRINSIC(intrinsic)
50 static const HashTableValue JSPositionErrorTableValues[] =
52 { "code", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorCode), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53 { "message", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorMessage), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
54 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
55 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
58 #undef THUNK_GENERATOR
59 static const HashTable JSPositionErrorTable = { 9, 7, JSPositionErrorTableValues, 0 };
60 /* Hash table for constructor */
62 #define THUNK_GENERATOR(generator) , generator
64 #define THUNK_GENERATOR(generator)
67 #define INTRINSIC(intrinsic) , intrinsic
69 #define INTRINSIC(intrinsic)
72 static const HashTableValue JSPositionErrorConstructorTableValues[] =
74 { "PERMISSION_DENIED", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorPERMISSION_DENIED), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
75 { "POSITION_UNAVAILABLE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorPOSITION_UNAVAILABLE), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
76 { "TIMEOUT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorTIMEOUT), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
77 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
80 #undef THUNK_GENERATOR
81 static const HashTable JSPositionErrorConstructorTable = { 9, 7, JSPositionErrorConstructorTableValues, 0 };
83 COMPILE_ASSERT(1 == PositionError::PERMISSION_DENIED, PositionErrorEnumPERMISSION_DENIEDIsWrongUseDontCheckEnums);
84 COMPILE_ASSERT(2 == PositionError::POSITION_UNAVAILABLE, PositionErrorEnumPOSITION_UNAVAILABLEIsWrongUseDontCheckEnums);
85 COMPILE_ASSERT(3 == PositionError::TIMEOUT, PositionErrorEnumTIMEOUTIsWrongUseDontCheckEnums);
87 const ClassInfo JSPositionErrorConstructor::s_info = { "PositionErrorConstructor", &DOMConstructorObject::s_info, &JSPositionErrorConstructorTable, 0, CREATE_METHOD_TABLE(JSPositionErrorConstructor) };
89 JSPositionErrorConstructor::JSPositionErrorConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
90 : DOMConstructorObject(structure, globalObject)
94 void JSPositionErrorConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
96 Base::finishCreation(exec->globalData());
97 ASSERT(inherits(&s_info));
98 putDirect(exec->globalData(), exec->propertyNames().prototype, JSPositionErrorPrototype::self(exec, globalObject), DontDelete | ReadOnly);
101 bool JSPositionErrorConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
103 return getStaticValueSlot<JSPositionErrorConstructor, JSDOMWrapper>(exec, &JSPositionErrorConstructorTable, static_cast<JSPositionErrorConstructor*>(cell), propertyName, slot);
106 bool JSPositionErrorConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
108 return getStaticValueDescriptor<JSPositionErrorConstructor, JSDOMWrapper>(exec, &JSPositionErrorConstructorTable, static_cast<JSPositionErrorConstructor*>(object), propertyName, descriptor);
111 /* Hash table for prototype */
113 #define THUNK_GENERATOR(generator) , generator
115 #define THUNK_GENERATOR(generator)
118 #define INTRINSIC(intrinsic) , intrinsic
120 #define INTRINSIC(intrinsic)
123 static const HashTableValue JSPositionErrorPrototypeTableValues[] =
125 { "PERMISSION_DENIED", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorPERMISSION_DENIED), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
126 { "POSITION_UNAVAILABLE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorPOSITION_UNAVAILABLE), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
127 { "TIMEOUT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPositionErrorTIMEOUT), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
128 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
131 #undef THUNK_GENERATOR
132 static const HashTable JSPositionErrorPrototypeTable = { 9, 7, JSPositionErrorPrototypeTableValues, 0 };
133 const ClassInfo JSPositionErrorPrototype::s_info = { "PositionErrorPrototype", &JSC::JSNonFinalObject::s_info, &JSPositionErrorPrototypeTable, 0, CREATE_METHOD_TABLE(JSPositionErrorPrototype) };
135 JSObject* JSPositionErrorPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
137 return getDOMPrototype<JSPositionError>(exec, globalObject);
140 bool JSPositionErrorPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
142 JSPositionErrorPrototype* thisObject = jsCast<JSPositionErrorPrototype*>(cell);
143 return getStaticValueSlot<JSPositionErrorPrototype, JSObject>(exec, &JSPositionErrorPrototypeTable, thisObject, propertyName, slot);
146 bool JSPositionErrorPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
148 JSPositionErrorPrototype* thisObject = jsCast<JSPositionErrorPrototype*>(object);
149 return getStaticValueDescriptor<JSPositionErrorPrototype, JSObject>(exec, &JSPositionErrorPrototypeTable, thisObject, propertyName, descriptor);
152 const ClassInfo JSPositionError::s_info = { "PositionError", &JSDOMWrapper::s_info, &JSPositionErrorTable, 0 , CREATE_METHOD_TABLE(JSPositionError) };
154 JSPositionError::JSPositionError(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<PositionError> impl)
155 : JSDOMWrapper(structure, globalObject)
156 , m_impl(impl.leakRef())
160 void JSPositionError::finishCreation(JSGlobalData& globalData)
162 Base::finishCreation(globalData);
163 ASSERT(inherits(&s_info));
166 JSObject* JSPositionError::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
168 return JSPositionErrorPrototype::create(exec->globalData(), globalObject, JSPositionErrorPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
171 bool JSPositionError::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
173 JSPositionError* thisObject = jsCast<JSPositionError*>(cell);
174 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
175 return getStaticValueSlot<JSPositionError, Base>(exec, &JSPositionErrorTable, thisObject, propertyName, slot);
178 bool JSPositionError::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
180 JSPositionError* thisObject = jsCast<JSPositionError*>(object);
181 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
182 return getStaticValueDescriptor<JSPositionError, Base>(exec, &JSPositionErrorTable, thisObject, propertyName, descriptor);
185 JSValue jsPositionErrorCode(ExecState* exec, JSValue slotBase, const Identifier&)
187 JSPositionError* castedThis = static_cast<JSPositionError*>(asObject(slotBase));
189 PositionError* imp = static_cast<PositionError*>(castedThis->impl());
190 JSValue result = jsNumber(imp->code());
195 JSValue jsPositionErrorMessage(ExecState* exec, JSValue slotBase, const Identifier&)
197 JSPositionError* castedThis = static_cast<JSPositionError*>(asObject(slotBase));
199 PositionError* imp = static_cast<PositionError*>(castedThis->impl());
200 JSValue result = jsString(exec, imp->message());
205 JSValue jsPositionErrorConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
207 JSPositionError* domObject = static_cast<JSPositionError*>(asObject(slotBase));
208 return JSPositionError::getConstructor(exec, domObject->globalObject());
211 JSValue JSPositionError::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
213 return getDOMConstructor<JSPositionErrorConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
218 JSValue jsPositionErrorPERMISSION_DENIED(ExecState* exec, JSValue, const Identifier&)
221 return jsNumber(static_cast<int>(1));
224 JSValue jsPositionErrorPOSITION_UNAVAILABLE(ExecState* exec, JSValue, const Identifier&)
227 return jsNumber(static_cast<int>(2));
230 JSValue jsPositionErrorTIMEOUT(ExecState* exec, JSValue, const Identifier&)
233 return jsNumber(static_cast<int>(3));
236 static inline bool isObservable(JSPositionError* jsPositionError)
238 if (jsPositionError->hasCustomProperties())
243 bool JSPositionErrorOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
245 JSPositionError* jsPositionError = static_cast<JSPositionError*>(handle.get().asCell());
246 if (!isObservable(jsPositionError))
248 UNUSED_PARAM(visitor);
252 void JSPositionErrorOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
254 JSPositionError* jsPositionError = static_cast<JSPositionError*>(handle.get().asCell());
255 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
256 uncacheWrapper(world, jsPositionError->impl(), jsPositionError);
257 jsPositionError->releaseImpl();
260 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, PositionError* impl)
262 return wrap<JSPositionError>(exec, globalObject, impl);
265 PositionError* toPositionError(JSC::JSValue value)
267 return value.inherits(&JSPositionError::s_info) ? static_cast<JSPositionError*>(asObject(value))->impl() : 0;
272 #endif // ENABLE(GEOLOCATION)