~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/generated/JSLocation.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
*/
20
20
 
21
21
#include "config.h"
22
 
 
23
22
#include "JSLocation.h"
24
23
 
25
 
#include <wtf/GetPtr.h>
26
 
 
27
24
#include "JSLocationCustom.h"
28
25
#include "KURL.h"
29
26
#include "Location.h"
30
 
 
31
27
#include <runtime/Error.h>
32
28
#include <runtime/JSString.h>
 
29
#include <wtf/GetPtr.h>
33
30
 
34
31
using namespace JSC;
35
32
 
36
33
namespace WebCore {
37
34
 
38
 
ASSERT_CLASS_FITS_IN_CELL(JSLocation)
 
35
ASSERT_CLASS_FITS_IN_CELL(JSLocation);
39
36
 
40
37
/* Hash table */
41
38
 
52
49
    { 0, 0, 0, 0 }
53
50
};
54
51
 
55
 
static const HashTable JSLocationTable =
 
52
static JSC_CONST_HASHTABLE HashTable JSLocationTable =
56
53
#if ENABLE(PERFECT_HASH_SIZE)
57
54
    { 63, JSLocationTableValues, 0 };
58
55
#else
70
67
    { 0, 0, 0, 0 }
71
68
};
72
69
 
73
 
static const HashTable JSLocationPrototypeTable =
 
70
static JSC_CONST_HASHTABLE HashTable JSLocationPrototypeTable =
74
71
#if ENABLE(PERFECT_HASH_SIZE)
75
72
    { 15, JSLocationPrototypeTableValues, 0 };
76
73
#else
89
86
    return getStaticFunctionSlot<JSObject>(exec, &JSLocationPrototypeTable, this, propertyName, slot);
90
87
}
91
88
 
 
89
bool JSLocationPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 
90
{
 
91
    return getStaticFunctionDescriptor<JSObject>(exec, &JSLocationPrototypeTable, this, propertyName, descriptor);
 
92
}
 
93
 
 
94
void JSLocationPrototype::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 
95
{
 
96
    if (putDelegate(exec, propertyName, value, slot))
 
97
        return;
 
98
    Base::put(exec, propertyName, value, slot);
 
99
}
 
100
 
92
101
const ClassInfo JSLocation::s_info = { "Location", 0, &JSLocationTable, 0 };
93
102
 
94
 
JSLocation::JSLocation(PassRefPtr<Structure> structure, PassRefPtr<Location> impl)
95
 
    : DOMObject(structure)
 
103
JSLocation::JSLocation(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<Location> impl)
 
104
    : DOMObjectWithGlobalPointer(structure, globalObject)
96
105
    , m_impl(impl)
97
106
{
98
107
}
99
108
 
100
109
JSLocation::~JSLocation()
101
110
{
102
 
    forgetDOMObject(*Heap::heap(this)->globalData(), m_impl.get());
103
 
 
 
111
    forgetDOMObject(*Heap::heap(this)->globalData(), impl());
104
112
}
105
113
 
106
114
JSObject* JSLocation::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
110
118
 
111
119
bool JSLocation::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
112
120
{
113
 
    if (customGetOwnPropertySlot(exec, propertyName, slot))
 
121
    if (getOwnPropertySlotDelegate(exec, propertyName, slot))
114
122
        return true;
115
123
    return getStaticValueSlot<JSLocation, Base>(exec, &JSLocationTable, this, propertyName, slot);
116
124
}
117
125
 
118
 
JSValuePtr jsLocationHref(ExecState* exec, const Identifier&, const PropertySlot& slot)
119
 
{
120
 
    Location* imp = static_cast<Location*>(static_cast<JSLocation*>(asObject(slot.slotBase()))->impl());
 
126
bool JSLocation::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 
127
{
 
128
    if (getOwnPropertyDescriptorDelegate(exec, propertyName, descriptor))
 
129
        return true;
 
130
    return getStaticValueDescriptor<JSLocation, Base>(exec, &JSLocationTable, this, propertyName, descriptor);
 
131
}
 
132
 
 
133
JSValue jsLocationHref(ExecState* exec, const Identifier&, const PropertySlot& slot)
 
134
{
 
135
    JSLocation* castedThis = static_cast<JSLocation*>(asObject(slot.slotBase()));
 
136
    UNUSED_PARAM(exec);
 
137
    Location* imp = static_cast<Location*>(castedThis->impl());
121
138
    return jsString(exec, imp->href());
122
139
}
123
140
 
124
 
JSValuePtr jsLocationProtocol(ExecState* exec, const Identifier&, const PropertySlot& slot)
 
141
JSValue jsLocationProtocol(ExecState* exec, const Identifier&, const PropertySlot& slot)
125
142
{
126
 
    Location* imp = static_cast<Location*>(static_cast<JSLocation*>(asObject(slot.slotBase()))->impl());
 
143
    JSLocation* castedThis = static_cast<JSLocation*>(asObject(slot.slotBase()));
 
144
    UNUSED_PARAM(exec);
 
145
    Location* imp = static_cast<Location*>(castedThis->impl());
127
146
    return jsString(exec, imp->protocol());
128
147
}
129
148
 
130
 
JSValuePtr jsLocationHost(ExecState* exec, const Identifier&, const PropertySlot& slot)
 
149
JSValue jsLocationHost(ExecState* exec, const Identifier&, const PropertySlot& slot)
131
150
{
132
 
    Location* imp = static_cast<Location*>(static_cast<JSLocation*>(asObject(slot.slotBase()))->impl());
 
151
    JSLocation* castedThis = static_cast<JSLocation*>(asObject(slot.slotBase()));
 
152
    UNUSED_PARAM(exec);
 
153
    Location* imp = static_cast<Location*>(castedThis->impl());
133
154
    return jsString(exec, imp->host());
134
155
}
135
156
 
136
 
JSValuePtr jsLocationHostname(ExecState* exec, const Identifier&, const PropertySlot& slot)
 
157
JSValue jsLocationHostname(ExecState* exec, const Identifier&, const PropertySlot& slot)
137
158
{
138
 
    Location* imp = static_cast<Location*>(static_cast<JSLocation*>(asObject(slot.slotBase()))->impl());
 
159
    JSLocation* castedThis = static_cast<JSLocation*>(asObject(slot.slotBase()));
 
160
    UNUSED_PARAM(exec);
 
161
    Location* imp = static_cast<Location*>(castedThis->impl());
139
162
    return jsString(exec, imp->hostname());
140
163
}
141
164
 
142
 
JSValuePtr jsLocationPort(ExecState* exec, const Identifier&, const PropertySlot& slot)
 
165
JSValue jsLocationPort(ExecState* exec, const Identifier&, const PropertySlot& slot)
143
166
{
144
 
    Location* imp = static_cast<Location*>(static_cast<JSLocation*>(asObject(slot.slotBase()))->impl());
 
167
    JSLocation* castedThis = static_cast<JSLocation*>(asObject(slot.slotBase()));
 
168
    UNUSED_PARAM(exec);
 
169
    Location* imp = static_cast<Location*>(castedThis->impl());
145
170
    return jsString(exec, imp->port());
146
171
}
147
172
 
148
 
JSValuePtr jsLocationPathname(ExecState* exec, const Identifier&, const PropertySlot& slot)
 
173
JSValue jsLocationPathname(ExecState* exec, const Identifier&, const PropertySlot& slot)
149
174
{
150
 
    Location* imp = static_cast<Location*>(static_cast<JSLocation*>(asObject(slot.slotBase()))->impl());
 
175
    JSLocation* castedThis = static_cast<JSLocation*>(asObject(slot.slotBase()));
 
176
    UNUSED_PARAM(exec);
 
177
    Location* imp = static_cast<Location*>(castedThis->impl());
151
178
    return jsString(exec, imp->pathname());
152
179
}
153
180
 
154
 
JSValuePtr jsLocationSearch(ExecState* exec, const Identifier&, const PropertySlot& slot)
 
181
JSValue jsLocationSearch(ExecState* exec, const Identifier&, const PropertySlot& slot)
155
182
{
156
 
    Location* imp = static_cast<Location*>(static_cast<JSLocation*>(asObject(slot.slotBase()))->impl());
 
183
    JSLocation* castedThis = static_cast<JSLocation*>(asObject(slot.slotBase()));
 
184
    UNUSED_PARAM(exec);
 
185
    Location* imp = static_cast<Location*>(castedThis->impl());
157
186
    return jsString(exec, imp->search());
158
187
}
159
188
 
160
 
JSValuePtr jsLocationHash(ExecState* exec, const Identifier&, const PropertySlot& slot)
 
189
JSValue jsLocationHash(ExecState* exec, const Identifier&, const PropertySlot& slot)
161
190
{
162
 
    Location* imp = static_cast<Location*>(static_cast<JSLocation*>(asObject(slot.slotBase()))->impl());
 
191
    JSLocation* castedThis = static_cast<JSLocation*>(asObject(slot.slotBase()));
 
192
    UNUSED_PARAM(exec);
 
193
    Location* imp = static_cast<Location*>(castedThis->impl());
163
194
    return jsString(exec, imp->hash());
164
195
}
165
196
 
166
 
void JSLocation::put(ExecState* exec, const Identifier& propertyName, JSValuePtr value, PutPropertySlot& slot)
 
197
void JSLocation::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
167
198
{
168
 
    if (customPut(exec, propertyName, value, slot))
 
199
    if (putDelegate(exec, propertyName, value, slot))
169
200
        return;
170
201
    lookupPut<JSLocation, Base>(exec, propertyName, value, &JSLocationTable, this, slot);
171
202
}
172
203
 
173
 
void setJSLocationHref(ExecState* exec, JSObject* thisObject, JSValuePtr value)
 
204
void setJSLocationHref(ExecState* exec, JSObject* thisObject, JSValue value)
174
205
{
175
206
    static_cast<JSLocation*>(thisObject)->setHref(exec, value);
176
207
}
177
208
 
178
 
void setJSLocationProtocol(ExecState* exec, JSObject* thisObject, JSValuePtr value)
 
209
void setJSLocationProtocol(ExecState* exec, JSObject* thisObject, JSValue value)
179
210
{
180
211
    static_cast<JSLocation*>(thisObject)->setProtocol(exec, value);
181
212
}
182
213
 
183
 
void setJSLocationHost(ExecState* exec, JSObject* thisObject, JSValuePtr value)
 
214
void setJSLocationHost(ExecState* exec, JSObject* thisObject, JSValue value)
184
215
{
185
216
    static_cast<JSLocation*>(thisObject)->setHost(exec, value);
186
217
}
187
218
 
188
 
void setJSLocationHostname(ExecState* exec, JSObject* thisObject, JSValuePtr value)
 
219
void setJSLocationHostname(ExecState* exec, JSObject* thisObject, JSValue value)
189
220
{
190
221
    static_cast<JSLocation*>(thisObject)->setHostname(exec, value);
191
222
}
192
223
 
193
 
void setJSLocationPort(ExecState* exec, JSObject* thisObject, JSValuePtr value)
 
224
void setJSLocationPort(ExecState* exec, JSObject* thisObject, JSValue value)
194
225
{
195
226
    static_cast<JSLocation*>(thisObject)->setPort(exec, value);
196
227
}
197
228
 
198
 
void setJSLocationPathname(ExecState* exec, JSObject* thisObject, JSValuePtr value)
 
229
void setJSLocationPathname(ExecState* exec, JSObject* thisObject, JSValue value)
199
230
{
200
231
    static_cast<JSLocation*>(thisObject)->setPathname(exec, value);
201
232
}
202
233
 
203
 
void setJSLocationSearch(ExecState* exec, JSObject* thisObject, JSValuePtr value)
 
234
void setJSLocationSearch(ExecState* exec, JSObject* thisObject, JSValue value)
204
235
{
205
236
    static_cast<JSLocation*>(thisObject)->setSearch(exec, value);
206
237
}
207
238
 
208
 
void setJSLocationHash(ExecState* exec, JSObject* thisObject, JSValuePtr value)
 
239
void setJSLocationHash(ExecState* exec, JSObject* thisObject, JSValue value)
209
240
{
210
241
    static_cast<JSLocation*>(thisObject)->setHash(exec, value);
211
242
}
212
243
 
213
 
void JSLocation::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames)
214
 
{
215
 
    if (customGetPropertyNames(exec, propertyNames))
216
 
        return;
217
 
     Base::getPropertyNames(exec, propertyNames);
218
 
}
219
 
 
220
 
JSValuePtr jsLocationPrototypeFunctionAssign(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
221
 
{
222
 
    if (!thisValue->isObject(&JSLocation::s_info))
 
244
JSValue JSC_HOST_CALL jsLocationPrototypeFunctionAssign(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
 
245
{
 
246
    UNUSED_PARAM(args);
 
247
    if (!thisValue.inherits(&JSLocation::s_info))
223
248
        return throwError(exec, TypeError);
224
249
    JSLocation* castedThisObj = static_cast<JSLocation*>(asObject(thisValue));
225
250
    return castedThisObj->assign(exec, args);
226
251
}
227
252
 
228
 
JSValuePtr jsLocationPrototypeFunctionReplace(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
 
253
JSValue JSC_HOST_CALL jsLocationPrototypeFunctionReplace(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
229
254
{
230
 
    if (!thisValue->isObject(&JSLocation::s_info))
 
255
    UNUSED_PARAM(args);
 
256
    if (!thisValue.inherits(&JSLocation::s_info))
231
257
        return throwError(exec, TypeError);
232
258
    JSLocation* castedThisObj = static_cast<JSLocation*>(asObject(thisValue));
233
259
    return castedThisObj->replace(exec, args);
234
260
}
235
261
 
236
 
JSValuePtr jsLocationPrototypeFunctionReload(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
 
262
JSValue JSC_HOST_CALL jsLocationPrototypeFunctionReload(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
237
263
{
238
 
    if (!thisValue->isObject(&JSLocation::s_info))
 
264
    UNUSED_PARAM(args);
 
265
    if (!thisValue.inherits(&JSLocation::s_info))
239
266
        return throwError(exec, TypeError);
240
267
    JSLocation* castedThisObj = static_cast<JSLocation*>(asObject(thisValue));
241
268
    return castedThisObj->reload(exec, args);
242
269
}
243
270
 
244
 
JSValuePtr jsLocationPrototypeFunctionToString(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
 
271
JSValue JSC_HOST_CALL jsLocationPrototypeFunctionToString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
245
272
{
246
 
    if (!thisValue->isObject(&JSLocation::s_info))
 
273
    UNUSED_PARAM(args);
 
274
    if (!thisValue.inherits(&JSLocation::s_info))
247
275
        return throwError(exec, TypeError);
248
276
    JSLocation* castedThisObj = static_cast<JSLocation*>(asObject(thisValue));
249
277
    return castedThisObj->toString(exec, args);
250
278
}
251
279
 
252
 
JSC::JSValuePtr toJS(JSC::ExecState* exec, Location* object)
 
280
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Location* object)
253
281
{
254
 
    return getDOMObjectWrapper<JSLocation>(exec, object);
 
282
    return getDOMObjectWrapper<JSLocation>(exec, globalObject, object);
255
283
}
256
 
Location* toLocation(JSC::JSValuePtr value)
 
284
Location* toLocation(JSC::JSValue value)
257
285
{
258
 
    return value->isObject(&JSLocation::s_info) ? static_cast<JSLocation*>(asObject(value))->impl() : 0;
 
286
    return value.inherits(&JSLocation::s_info) ? static_cast<JSLocation*>(asObject(value))->impl() : 0;
259
287
}
260
288
 
261
289
}