diff -r 000000000000 -r 4f2f89ce4247 WebCore/generated/JSLocation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WebCore/generated/JSLocation.cpp Fri Sep 17 09:02:29 2010 +0300 @@ -0,0 +1,297 @@ +/* + This file is part of the WebKit open source project. + This file has been generated by generate-bindings.pl. DO NOT MODIFY! + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" +#include "JSLocation.h" + +#include "JSLocationCustom.h" +#include "KURL.h" +#include "Location.h" +#include +#include +#include + +using namespace JSC; + +namespace WebCore { + +ASSERT_CLASS_FITS_IN_CELL(JSLocation); + +/* Hash table */ +#if ENABLE(JIT) +#define THUNK_GENERATOR(generator) , generator +#else +#define THUNK_GENERATOR(generator) +#endif + +static const HashTableValue JSLocationTableValues[9] = +{ + { "href", DontDelete, (intptr_t)static_cast(jsLocationHref), (intptr_t)setJSLocationHref THUNK_GENERATOR(0) }, + { "protocol", DontDelete, (intptr_t)static_cast(jsLocationProtocol), (intptr_t)setJSLocationProtocol THUNK_GENERATOR(0) }, + { "host", DontDelete, (intptr_t)static_cast(jsLocationHost), (intptr_t)setJSLocationHost THUNK_GENERATOR(0) }, + { "hostname", DontDelete, (intptr_t)static_cast(jsLocationHostname), (intptr_t)setJSLocationHostname THUNK_GENERATOR(0) }, + { "port", DontDelete, (intptr_t)static_cast(jsLocationPort), (intptr_t)setJSLocationPort THUNK_GENERATOR(0) }, + { "pathname", DontDelete, (intptr_t)static_cast(jsLocationPathname), (intptr_t)setJSLocationPathname THUNK_GENERATOR(0) }, + { "search", DontDelete, (intptr_t)static_cast(jsLocationSearch), (intptr_t)setJSLocationSearch THUNK_GENERATOR(0) }, + { "hash", DontDelete, (intptr_t)static_cast(jsLocationHash), (intptr_t)setJSLocationHash THUNK_GENERATOR(0) }, + { 0, 0, 0, 0 THUNK_GENERATOR(0) } +}; + +#undef THUNK_GENERATOR +static JSC_CONST_HASHTABLE HashTable JSLocationTable = { 19, 15, JSLocationTableValues, 0 }; +/* Hash table for prototype */ +#if ENABLE(JIT) +#define THUNK_GENERATOR(generator) , generator +#else +#define THUNK_GENERATOR(generator) +#endif + +static const HashTableValue JSLocationPrototypeTableValues[5] = +{ + { "assign", DontDelete | Function, (intptr_t)static_cast(jsLocationPrototypeFunctionAssign), (intptr_t)1 THUNK_GENERATOR(0) }, + { "replace", DontDelete | Function, (intptr_t)static_cast(jsLocationPrototypeFunctionReplace), (intptr_t)1 THUNK_GENERATOR(0) }, + { "reload", DontDelete | Function, (intptr_t)static_cast(jsLocationPrototypeFunctionReload), (intptr_t)0 THUNK_GENERATOR(0) }, + { "toString", DontDelete | DontEnum | Function, (intptr_t)static_cast(jsLocationPrototypeFunctionToString), (intptr_t)0 THUNK_GENERATOR(0) }, + { 0, 0, 0, 0 THUNK_GENERATOR(0) } +}; + +#undef THUNK_GENERATOR +static JSC_CONST_HASHTABLE HashTable JSLocationPrototypeTable = { 9, 7, JSLocationPrototypeTableValues, 0 }; +const ClassInfo JSLocationPrototype::s_info = { "LocationPrototype", 0, &JSLocationPrototypeTable, 0 }; + +JSObject* JSLocationPrototype::self(ExecState* exec, JSGlobalObject* globalObject) +{ + return getDOMPrototype(exec, globalObject); +} + +bool JSLocationPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + return getStaticFunctionSlot(exec, &JSLocationPrototypeTable, this, propertyName, slot); +} + +bool JSLocationPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +{ + return getStaticFunctionDescriptor(exec, &JSLocationPrototypeTable, this, propertyName, descriptor); +} + +void JSLocationPrototype::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) +{ + if (putDelegate(exec, propertyName, value, slot)) + return; + Base::put(exec, propertyName, value, slot); +} + +const ClassInfo JSLocation::s_info = { "Location", 0, &JSLocationTable, 0 }; + +JSLocation::JSLocation(NonNullPassRefPtr structure, JSDOMGlobalObject* globalObject, PassRefPtr impl) + : DOMObjectWithGlobalPointer(structure, globalObject) + , m_impl(impl) +{ +} + +JSLocation::~JSLocation() +{ + forgetDOMObject(this, impl()); +} + +JSObject* JSLocation::createPrototype(ExecState* exec, JSGlobalObject* globalObject) +{ + return new (exec) JSLocationPrototype(globalObject, JSLocationPrototype::createStructure(globalObject->objectPrototype())); +} + +bool JSLocation::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + if (getOwnPropertySlotDelegate(exec, propertyName, slot)) + return true; + return getStaticValueSlot(exec, &JSLocationTable, this, propertyName, slot); +} + +bool JSLocation::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +{ + if (getOwnPropertyDescriptorDelegate(exec, propertyName, descriptor)) + return true; + return getStaticValueDescriptor(exec, &JSLocationTable, this, propertyName, descriptor); +} + +JSValue jsLocationHref(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSLocation* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Location* imp = static_cast(castedThis->impl()); + JSValue result = jsString(exec, imp->href()); + return result; +} + +JSValue jsLocationProtocol(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSLocation* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Location* imp = static_cast(castedThis->impl()); + JSValue result = jsString(exec, imp->protocol()); + return result; +} + +JSValue jsLocationHost(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSLocation* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Location* imp = static_cast(castedThis->impl()); + JSValue result = jsString(exec, imp->host()); + return result; +} + +JSValue jsLocationHostname(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSLocation* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Location* imp = static_cast(castedThis->impl()); + JSValue result = jsString(exec, imp->hostname()); + return result; +} + +JSValue jsLocationPort(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSLocation* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Location* imp = static_cast(castedThis->impl()); + JSValue result = jsString(exec, imp->port()); + return result; +} + +JSValue jsLocationPathname(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSLocation* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Location* imp = static_cast(castedThis->impl()); + JSValue result = jsString(exec, imp->pathname()); + return result; +} + +JSValue jsLocationSearch(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSLocation* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Location* imp = static_cast(castedThis->impl()); + JSValue result = jsString(exec, imp->search()); + return result; +} + +JSValue jsLocationHash(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSLocation* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Location* imp = static_cast(castedThis->impl()); + JSValue result = jsString(exec, imp->hash()); + return result; +} + +void JSLocation::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) +{ + if (putDelegate(exec, propertyName, value, slot)) + return; + lookupPut(exec, propertyName, value, &JSLocationTable, this, slot); +} + +void setJSLocationHref(ExecState* exec, JSObject* thisObject, JSValue value) +{ + static_cast(thisObject)->setHref(exec, value); +} + +void setJSLocationProtocol(ExecState* exec, JSObject* thisObject, JSValue value) +{ + static_cast(thisObject)->setProtocol(exec, value); +} + +void setJSLocationHost(ExecState* exec, JSObject* thisObject, JSValue value) +{ + static_cast(thisObject)->setHost(exec, value); +} + +void setJSLocationHostname(ExecState* exec, JSObject* thisObject, JSValue value) +{ + static_cast(thisObject)->setHostname(exec, value); +} + +void setJSLocationPort(ExecState* exec, JSObject* thisObject, JSValue value) +{ + static_cast(thisObject)->setPort(exec, value); +} + +void setJSLocationPathname(ExecState* exec, JSObject* thisObject, JSValue value) +{ + static_cast(thisObject)->setPathname(exec, value); +} + +void setJSLocationSearch(ExecState* exec, JSObject* thisObject, JSValue value) +{ + static_cast(thisObject)->setSearch(exec, value); +} + +void setJSLocationHash(ExecState* exec, JSObject* thisObject, JSValue value) +{ + static_cast(thisObject)->setHash(exec, value); +} + +EncodedJSValue JSC_HOST_CALL jsLocationPrototypeFunctionAssign(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + if (!thisValue.inherits(&JSLocation::s_info)) + return throwVMTypeError(exec); + JSLocation* castedThis = static_cast(asObject(thisValue)); + return JSValue::encode(castedThis->assign(exec)); +} + +EncodedJSValue JSC_HOST_CALL jsLocationPrototypeFunctionReplace(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + if (!thisValue.inherits(&JSLocation::s_info)) + return throwVMTypeError(exec); + JSLocation* castedThis = static_cast(asObject(thisValue)); + return JSValue::encode(castedThis->replace(exec)); +} + +EncodedJSValue JSC_HOST_CALL jsLocationPrototypeFunctionReload(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + if (!thisValue.inherits(&JSLocation::s_info)) + return throwVMTypeError(exec); + JSLocation* castedThis = static_cast(asObject(thisValue)); + return JSValue::encode(castedThis->reload(exec)); +} + +EncodedJSValue JSC_HOST_CALL jsLocationPrototypeFunctionToString(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + if (!thisValue.inherits(&JSLocation::s_info)) + return throwVMTypeError(exec); + JSLocation* castedThis = static_cast(asObject(thisValue)); + return JSValue::encode(castedThis->toString(exec)); +} + +JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Location* object) +{ + return getDOMObjectWrapper(exec, globalObject, object); +} +Location* toLocation(JSC::JSValue value) +{ + return value.inherits(&JSLocation::s_info) ? static_cast(asObject(value))->impl() : 0; +} + +}