|
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 "JSNavigation.h" |
|
26 |
|
27 #include "Navigation.h" |
|
28 #include <runtime/JSNumberCell.h> |
|
29 #include <wtf/GetPtr.h> |
|
30 |
|
31 using namespace JSC; |
|
32 |
|
33 namespace WebCore { |
|
34 |
|
35 ASSERT_CLASS_FITS_IN_CELL(JSNavigation); |
|
36 |
|
37 /* Hash table */ |
|
38 #if ENABLE(JIT) |
|
39 #define THUNK_GENERATOR(generator) , generator |
|
40 #else |
|
41 #define THUNK_GENERATOR(generator) |
|
42 #endif |
|
43 |
|
44 static const HashTableValue JSNavigationTableValues[3] = |
|
45 { |
|
46 { "type", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigationType), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
47 { "redirectCount", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigationRedirectCount), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
48 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
49 }; |
|
50 |
|
51 #undef THUNK_GENERATOR |
|
52 static JSC_CONST_HASHTABLE HashTable JSNavigationTable = { 5, 3, JSNavigationTableValues, 0 }; |
|
53 /* Hash table for prototype */ |
|
54 #if ENABLE(JIT) |
|
55 #define THUNK_GENERATOR(generator) , generator |
|
56 #else |
|
57 #define THUNK_GENERATOR(generator) |
|
58 #endif |
|
59 |
|
60 static const HashTableValue JSNavigationPrototypeTableValues[4] = |
|
61 { |
|
62 { "NAVIGATE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigationNAVIGATE), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
63 { "RELOAD", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigationRELOAD), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
64 { "BACK_FORWARD", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNavigationBACK_FORWARD), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
65 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
66 }; |
|
67 |
|
68 #undef THUNK_GENERATOR |
|
69 static JSC_CONST_HASHTABLE HashTable JSNavigationPrototypeTable = { 8, 7, JSNavigationPrototypeTableValues, 0 }; |
|
70 const ClassInfo JSNavigationPrototype::s_info = { "NavigationPrototype", 0, &JSNavigationPrototypeTable, 0 }; |
|
71 |
|
72 JSObject* JSNavigationPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
73 { |
|
74 return getDOMPrototype<JSNavigation>(exec, globalObject); |
|
75 } |
|
76 |
|
77 bool JSNavigationPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
78 { |
|
79 return getStaticValueSlot<JSNavigationPrototype, JSObject>(exec, &JSNavigationPrototypeTable, this, propertyName, slot); |
|
80 } |
|
81 |
|
82 bool JSNavigationPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
83 { |
|
84 return getStaticValueDescriptor<JSNavigationPrototype, JSObject>(exec, &JSNavigationPrototypeTable, this, propertyName, descriptor); |
|
85 } |
|
86 |
|
87 const ClassInfo JSNavigation::s_info = { "Navigation", 0, &JSNavigationTable, 0 }; |
|
88 |
|
89 JSNavigation::JSNavigation(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<Navigation> impl) |
|
90 : DOMObjectWithGlobalPointer(structure, globalObject) |
|
91 , m_impl(impl) |
|
92 { |
|
93 } |
|
94 |
|
95 JSNavigation::~JSNavigation() |
|
96 { |
|
97 forgetDOMObject(this, impl()); |
|
98 } |
|
99 |
|
100 JSObject* JSNavigation::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
101 { |
|
102 return new (exec) JSNavigationPrototype(globalObject, JSNavigationPrototype::createStructure(globalObject->objectPrototype())); |
|
103 } |
|
104 |
|
105 bool JSNavigation::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
106 { |
|
107 return getStaticValueSlot<JSNavigation, Base>(exec, &JSNavigationTable, this, propertyName, slot); |
|
108 } |
|
109 |
|
110 bool JSNavigation::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
111 { |
|
112 return getStaticValueDescriptor<JSNavigation, Base>(exec, &JSNavigationTable, this, propertyName, descriptor); |
|
113 } |
|
114 |
|
115 JSValue jsNavigationType(ExecState* exec, JSValue slotBase, const Identifier&) |
|
116 { |
|
117 JSNavigation* castedThis = static_cast<JSNavigation*>(asObject(slotBase)); |
|
118 UNUSED_PARAM(exec); |
|
119 Navigation* imp = static_cast<Navigation*>(castedThis->impl()); |
|
120 JSValue result = jsNumber(exec, imp->type()); |
|
121 return result; |
|
122 } |
|
123 |
|
124 JSValue jsNavigationRedirectCount(ExecState* exec, JSValue slotBase, const Identifier&) |
|
125 { |
|
126 JSNavigation* castedThis = static_cast<JSNavigation*>(asObject(slotBase)); |
|
127 UNUSED_PARAM(exec); |
|
128 Navigation* imp = static_cast<Navigation*>(castedThis->impl()); |
|
129 JSValue result = jsNumber(exec, imp->redirectCount()); |
|
130 return result; |
|
131 } |
|
132 |
|
133 // Constant getters |
|
134 |
|
135 JSValue jsNavigationNAVIGATE(ExecState* exec, JSValue, const Identifier&) |
|
136 { |
|
137 return jsNumber(exec, static_cast<int>(0)); |
|
138 } |
|
139 |
|
140 JSValue jsNavigationRELOAD(ExecState* exec, JSValue, const Identifier&) |
|
141 { |
|
142 return jsNumber(exec, static_cast<int>(1)); |
|
143 } |
|
144 |
|
145 JSValue jsNavigationBACK_FORWARD(ExecState* exec, JSValue, const Identifier&) |
|
146 { |
|
147 return jsNumber(exec, static_cast<int>(2)); |
|
148 } |
|
149 |
|
150 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Navigation* object) |
|
151 { |
|
152 return getDOMObjectWrapper<JSNavigation>(exec, globalObject, object); |
|
153 } |
|
154 Navigation* toNavigation(JSC::JSValue value) |
|
155 { |
|
156 return value.inherits(&JSNavigation::s_info) ? static_cast<JSNavigation*>(asObject(value))->impl() : 0; |
|
157 } |
|
158 |
|
159 } |
|
160 |
|
161 #endif // ENABLE(WEB_TIMING) |