tizen beta release
[framework/web/webkit-efl.git] / DerivedSources / WebCore / JSPerformanceNavigation.cpp
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(WEB_TIMING)
24
25 #include "JSPerformanceNavigation.h"
26
27 #include "PerformanceNavigation.h"
28 #include <wtf/GetPtr.h>
29
30 using namespace JSC;
31
32 namespace WebCore {
33
34 ASSERT_CLASS_FITS_IN_CELL(JSPerformanceNavigation);
35
36 /* Hash table */
37 #if ENABLE(JIT)
38 #define THUNK_GENERATOR(generator) , generator
39 #else
40 #define THUNK_GENERATOR(generator)
41 #endif
42 #if ENABLE(DFG_JIT)
43 #define INTRINSIC(intrinsic) , intrinsic
44 #else
45 #define INTRINSIC(intrinsic)
46 #endif
47
48 static const HashTableValue JSPerformanceNavigationTableValues[] =
49 {
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) }
53 };
54
55 #undef THUNK_GENERATOR
56 static const HashTable JSPerformanceNavigationTable = { 5, 3, JSPerformanceNavigationTableValues, 0 };
57 /* Hash table for prototype */
58 #if ENABLE(JIT)
59 #define THUNK_GENERATOR(generator) , generator
60 #else
61 #define THUNK_GENERATOR(generator)
62 #endif
63 #if ENABLE(DFG_JIT)
64 #define INTRINSIC(intrinsic) , intrinsic
65 #else
66 #define INTRINSIC(intrinsic)
67 #endif
68
69 static const HashTableValue JSPerformanceNavigationPrototypeTableValues[] =
70 {
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) }
76 };
77
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) };
81
82 JSObject* JSPerformanceNavigationPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
83 {
84     return getDOMPrototype<JSPerformanceNavigation>(exec, globalObject);
85 }
86
87 bool JSPerformanceNavigationPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
88 {
89     JSPerformanceNavigationPrototype* thisObject = jsCast<JSPerformanceNavigationPrototype*>(cell);
90     return getStaticValueSlot<JSPerformanceNavigationPrototype, JSObject>(exec, &JSPerformanceNavigationPrototypeTable, thisObject, propertyName, slot);
91 }
92
93 bool JSPerformanceNavigationPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
94 {
95     JSPerformanceNavigationPrototype* thisObject = jsCast<JSPerformanceNavigationPrototype*>(object);
96     return getStaticValueDescriptor<JSPerformanceNavigationPrototype, JSObject>(exec, &JSPerformanceNavigationPrototypeTable, thisObject, propertyName, descriptor);
97 }
98
99 const ClassInfo JSPerformanceNavigation::s_info = { "PerformanceNavigation", &JSDOMWrapper::s_info, &JSPerformanceNavigationTable, 0 , CREATE_METHOD_TABLE(JSPerformanceNavigation) };
100
101 JSPerformanceNavigation::JSPerformanceNavigation(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<PerformanceNavigation> impl)
102     : JSDOMWrapper(structure, globalObject)
103     , m_impl(impl.leakRef())
104 {
105 }
106
107 void JSPerformanceNavigation::finishCreation(JSGlobalData& globalData)
108 {
109     Base::finishCreation(globalData);
110     ASSERT(inherits(&s_info));
111 }
112
113 JSObject* JSPerformanceNavigation::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
114 {
115     return JSPerformanceNavigationPrototype::create(exec->globalData(), globalObject, JSPerformanceNavigationPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
116 }
117
118 bool JSPerformanceNavigation::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
119 {
120     JSPerformanceNavigation* thisObject = jsCast<JSPerformanceNavigation*>(cell);
121     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
122     return getStaticValueSlot<JSPerformanceNavigation, Base>(exec, &JSPerformanceNavigationTable, thisObject, propertyName, slot);
123 }
124
125 bool JSPerformanceNavigation::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
126 {
127     JSPerformanceNavigation* thisObject = jsCast<JSPerformanceNavigation*>(object);
128     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
129     return getStaticValueDescriptor<JSPerformanceNavigation, Base>(exec, &JSPerformanceNavigationTable, thisObject, propertyName, descriptor);
130 }
131
132 JSValue jsPerformanceNavigationType(ExecState* exec, JSValue slotBase, const Identifier&)
133 {
134     JSPerformanceNavigation* castedThis = static_cast<JSPerformanceNavigation*>(asObject(slotBase));
135     UNUSED_PARAM(exec);
136     PerformanceNavigation* imp = static_cast<PerformanceNavigation*>(castedThis->impl());
137     JSValue result = jsNumber(imp->type());
138     return result;
139 }
140
141
142 JSValue jsPerformanceNavigationRedirectCount(ExecState* exec, JSValue slotBase, const Identifier&)
143 {
144     JSPerformanceNavigation* castedThis = static_cast<JSPerformanceNavigation*>(asObject(slotBase));
145     UNUSED_PARAM(exec);
146     PerformanceNavigation* imp = static_cast<PerformanceNavigation*>(castedThis->impl());
147     JSValue result = jsNumber(imp->redirectCount());
148     return result;
149 }
150
151
152 // Constant getters
153
154 JSValue jsPerformanceNavigationTYPE_NAVIGATE(ExecState* exec, JSValue, const Identifier&)
155 {
156     UNUSED_PARAM(exec);
157     return jsNumber(static_cast<int>(0));
158 }
159
160 JSValue jsPerformanceNavigationTYPE_RELOAD(ExecState* exec, JSValue, const Identifier&)
161 {
162     UNUSED_PARAM(exec);
163     return jsNumber(static_cast<int>(1));
164 }
165
166 JSValue jsPerformanceNavigationTYPE_BACK_FORWARD(ExecState* exec, JSValue, const Identifier&)
167 {
168     UNUSED_PARAM(exec);
169     return jsNumber(static_cast<int>(2));
170 }
171
172 JSValue jsPerformanceNavigationTYPE_RESERVED(ExecState* exec, JSValue, const Identifier&)
173 {
174     UNUSED_PARAM(exec);
175     return jsNumber(static_cast<int>(255));
176 }
177
178 static inline bool isObservable(JSPerformanceNavigation* jsPerformanceNavigation)
179 {
180     if (jsPerformanceNavigation->hasCustomProperties())
181         return true;
182     return false;
183 }
184
185 bool JSPerformanceNavigationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
186 {
187     JSPerformanceNavigation* jsPerformanceNavigation = static_cast<JSPerformanceNavigation*>(handle.get().asCell());
188     if (!isObservable(jsPerformanceNavigation))
189         return false;
190     UNUSED_PARAM(visitor);
191     return false;
192 }
193
194 void JSPerformanceNavigationOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
195 {
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();
200 }
201
202 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, PerformanceNavigation* impl)
203 {
204     return wrap<JSPerformanceNavigation>(exec, globalObject, impl);
205 }
206
207 PerformanceNavigation* toPerformanceNavigation(JSC::JSValue value)
208 {
209     return value.inherits(&JSPerformanceNavigation::s_info) ? static_cast<JSPerformanceNavigation*>(asObject(value))->impl() : 0;
210 }
211
212 }
213
214 #endif // ENABLE(WEB_TIMING)