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(WEB_TIMING)
25 #include "JSPerformanceNavigation.h"
27 #include "PerformanceNavigation.h"
28 #include <wtf/GetPtr.h>
34 ASSERT_CLASS_FITS_IN_CELL(JSPerformanceNavigation);
38 #define THUNK_GENERATOR(generator) , generator
40 #define THUNK_GENERATOR(generator)
43 #define INTRINSIC(intrinsic) , intrinsic
45 #define INTRINSIC(intrinsic)
48 static const HashTableValue JSPerformanceNavigationTableValues[] =
50 { "type", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPerformanceNavigationType), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
51 { "redirectCount", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPerformanceNavigationRedirectCount), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
52 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
55 #undef THUNK_GENERATOR
56 static const HashTable JSPerformanceNavigationTable = { 5, 3, JSPerformanceNavigationTableValues, 0 };
57 /* Hash table for prototype */
59 #define THUNK_GENERATOR(generator) , generator
61 #define THUNK_GENERATOR(generator)
64 #define INTRINSIC(intrinsic) , intrinsic
66 #define INTRINSIC(intrinsic)
69 static const HashTableValue JSPerformanceNavigationPrototypeTableValues[] =
71 { "TYPE_NAVIGATE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPerformanceNavigationTYPE_NAVIGATE), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
72 { "TYPE_RELOAD", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPerformanceNavigationTYPE_RELOAD), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
73 { "TYPE_BACK_FORWARD", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPerformanceNavigationTYPE_BACK_FORWARD), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
74 { "TYPE_RESERVED", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPerformanceNavigationTYPE_RESERVED), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
75 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
78 #undef THUNK_GENERATOR
79 static const HashTable JSPerformanceNavigationPrototypeTable = { 9, 7, JSPerformanceNavigationPrototypeTableValues, 0 };
80 const ClassInfo JSPerformanceNavigationPrototype::s_info = { "PerformanceNavigationPrototype", &JSC::JSNonFinalObject::s_info, &JSPerformanceNavigationPrototypeTable, 0, CREATE_METHOD_TABLE(JSPerformanceNavigationPrototype) };
82 JSObject* JSPerformanceNavigationPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
84 return getDOMPrototype<JSPerformanceNavigation>(exec, globalObject);
87 bool JSPerformanceNavigationPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
89 JSPerformanceNavigationPrototype* thisObject = jsCast<JSPerformanceNavigationPrototype*>(cell);
90 return getStaticValueSlot<JSPerformanceNavigationPrototype, JSObject>(exec, &JSPerformanceNavigationPrototypeTable, thisObject, propertyName, slot);
93 bool JSPerformanceNavigationPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
95 JSPerformanceNavigationPrototype* thisObject = jsCast<JSPerformanceNavigationPrototype*>(object);
96 return getStaticValueDescriptor<JSPerformanceNavigationPrototype, JSObject>(exec, &JSPerformanceNavigationPrototypeTable, thisObject, propertyName, descriptor);
99 const ClassInfo JSPerformanceNavigation::s_info = { "PerformanceNavigation", &JSDOMWrapper::s_info, &JSPerformanceNavigationTable, 0 , CREATE_METHOD_TABLE(JSPerformanceNavigation) };
101 JSPerformanceNavigation::JSPerformanceNavigation(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<PerformanceNavigation> impl)
102 : JSDOMWrapper(structure, globalObject)
103 , m_impl(impl.leakRef())
107 void JSPerformanceNavigation::finishCreation(JSGlobalData& globalData)
109 Base::finishCreation(globalData);
110 ASSERT(inherits(&s_info));
113 JSObject* JSPerformanceNavigation::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
115 return JSPerformanceNavigationPrototype::create(exec->globalData(), globalObject, JSPerformanceNavigationPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
118 bool JSPerformanceNavigation::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
120 JSPerformanceNavigation* thisObject = jsCast<JSPerformanceNavigation*>(cell);
121 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
122 return getStaticValueSlot<JSPerformanceNavigation, Base>(exec, &JSPerformanceNavigationTable, thisObject, propertyName, slot);
125 bool JSPerformanceNavigation::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
127 JSPerformanceNavigation* thisObject = jsCast<JSPerformanceNavigation*>(object);
128 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
129 return getStaticValueDescriptor<JSPerformanceNavigation, Base>(exec, &JSPerformanceNavigationTable, thisObject, propertyName, descriptor);
132 JSValue jsPerformanceNavigationType(ExecState* exec, JSValue slotBase, const Identifier&)
134 JSPerformanceNavigation* castedThis = static_cast<JSPerformanceNavigation*>(asObject(slotBase));
136 PerformanceNavigation* imp = static_cast<PerformanceNavigation*>(castedThis->impl());
137 JSValue result = jsNumber(imp->type());
142 JSValue jsPerformanceNavigationRedirectCount(ExecState* exec, JSValue slotBase, const Identifier&)
144 JSPerformanceNavigation* castedThis = static_cast<JSPerformanceNavigation*>(asObject(slotBase));
146 PerformanceNavigation* imp = static_cast<PerformanceNavigation*>(castedThis->impl());
147 JSValue result = jsNumber(imp->redirectCount());
154 JSValue jsPerformanceNavigationTYPE_NAVIGATE(ExecState* exec, JSValue, const Identifier&)
157 return jsNumber(static_cast<int>(0));
160 JSValue jsPerformanceNavigationTYPE_RELOAD(ExecState* exec, JSValue, const Identifier&)
163 return jsNumber(static_cast<int>(1));
166 JSValue jsPerformanceNavigationTYPE_BACK_FORWARD(ExecState* exec, JSValue, const Identifier&)
169 return jsNumber(static_cast<int>(2));
172 JSValue jsPerformanceNavigationTYPE_RESERVED(ExecState* exec, JSValue, const Identifier&)
175 return jsNumber(static_cast<int>(255));
178 static inline bool isObservable(JSPerformanceNavigation* jsPerformanceNavigation)
180 if (jsPerformanceNavigation->hasCustomProperties())
185 bool JSPerformanceNavigationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
187 JSPerformanceNavigation* jsPerformanceNavigation = static_cast<JSPerformanceNavigation*>(handle.get().asCell());
188 if (!isObservable(jsPerformanceNavigation))
190 UNUSED_PARAM(visitor);
194 void JSPerformanceNavigationOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
196 JSPerformanceNavigation* jsPerformanceNavigation = static_cast<JSPerformanceNavigation*>(handle.get().asCell());
197 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
198 uncacheWrapper(world, jsPerformanceNavigation->impl(), jsPerformanceNavigation);
199 jsPerformanceNavigation->releaseImpl();
202 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, PerformanceNavigation* impl)
204 return wrap<JSPerformanceNavigation>(exec, globalObject, impl);
207 PerformanceNavigation* toPerformanceNavigation(JSC::JSValue value)
209 return value.inherits(&JSPerformanceNavigation::s_info) ? static_cast<JSPerformanceNavigation*>(asObject(value))->impl() : 0;
214 #endif // ENABLE(WEB_TIMING)