blob: f85197a7c1a3bf77e676987b3c5891aae4a878fa [file] [log] [blame]
/*
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 "JSSQLTransaction.h"
#include "JSDOMBinding.h"
#include "JSDOMConstructor.h"
#include <runtime/Error.h>
#include <runtime/FunctionPrototype.h>
#include <wtf/GetPtr.h>
using namespace JSC;
namespace WebCore {
// Functions
JSC::EncodedJSValue JSC_HOST_CALL jsSQLTransactionPrototypeFunctionExecuteSql(JSC::ExecState*);
// Attributes
JSC::EncodedJSValue jsSQLTransactionConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
bool setJSSQLTransactionConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
class JSSQLTransactionPrototype : public JSC::JSNonFinalObject {
public:
typedef JSC::JSNonFinalObject Base;
static JSSQLTransactionPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
{
JSSQLTransactionPrototype* ptr = new (NotNull, JSC::allocateCell<JSSQLTransactionPrototype>(vm.heap)) JSSQLTransactionPrototype(vm, globalObject, structure);
ptr->finishCreation(vm);
return ptr;
}
DECLARE_INFO;
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
{
return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
}
private:
JSSQLTransactionPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
: JSC::JSNonFinalObject(vm, structure)
{
}
void finishCreation(JSC::VM&);
};
typedef JSDOMConstructorNotConstructable<JSSQLTransaction> JSSQLTransactionConstructor;
template<> JSValue JSSQLTransactionConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
{
UNUSED_PARAM(vm);
return globalObject.functionPrototype();
}
template<> void JSSQLTransactionConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
{
putDirect(vm, vm.propertyNames->prototype, JSSQLTransaction::prototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum);
putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("SQLTransaction"))), ReadOnly | DontEnum);
putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
}
template<> const ClassInfo JSSQLTransactionConstructor::s_info = { "SQLTransaction", &Base::s_info, 0, CREATE_METHOD_TABLE(JSSQLTransactionConstructor) };
/* Hash table for prototype */
static const HashTableValue JSSQLTransactionPrototypeTableValues[] =
{
{ "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLTransactionConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSQLTransactionConstructor) } },
{ "executeSql", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsSQLTransactionPrototypeFunctionExecuteSql), (intptr_t) (2) } },
};
const ClassInfo JSSQLTransactionPrototype::s_info = { "SQLTransactionPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSSQLTransactionPrototype) };
void JSSQLTransactionPrototype::finishCreation(VM& vm)
{
Base::finishCreation(vm);
reifyStaticProperties(vm, JSSQLTransactionPrototypeTableValues, *this);
}
const ClassInfo JSSQLTransaction::s_info = { "SQLTransaction", &Base::s_info, 0, CREATE_METHOD_TABLE(JSSQLTransaction) };
JSSQLTransaction::JSSQLTransaction(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SQLTransaction>&& impl)
: JSDOMWrapper<SQLTransaction>(structure, globalObject, WTFMove(impl))
{
}
JSObject* JSSQLTransaction::createPrototype(VM& vm, JSGlobalObject* globalObject)
{
return JSSQLTransactionPrototype::create(vm, globalObject, JSSQLTransactionPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
}
JSObject* JSSQLTransaction::prototype(VM& vm, JSGlobalObject* globalObject)
{
return getDOMPrototype<JSSQLTransaction>(vm, globalObject);
}
void JSSQLTransaction::destroy(JSC::JSCell* cell)
{
JSSQLTransaction* thisObject = static_cast<JSSQLTransaction*>(cell);
thisObject->JSSQLTransaction::~JSSQLTransaction();
}
EncodedJSValue jsSQLTransactionConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
JSSQLTransactionPrototype* domObject = jsDynamicCast<JSSQLTransactionPrototype*>(JSValue::decode(thisValue));
if (UNLIKELY(!domObject))
return throwVMTypeError(state, throwScope);
return JSValue::encode(JSSQLTransaction::getConstructor(state->vm(), domObject->globalObject()));
}
bool setJSSQLTransactionConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
JSValue value = JSValue::decode(encodedValue);
JSSQLTransactionPrototype* domObject = jsDynamicCast<JSSQLTransactionPrototype*>(JSValue::decode(thisValue));
if (UNLIKELY(!domObject)) {
throwVMTypeError(state, throwScope);
return false;
}
// Shadowing a built-in constructor
return domObject->putDirect(state->vm(), state->propertyNames().constructor, value);
}
JSValue JSSQLTransaction::getConstructor(VM& vm, const JSGlobalObject* globalObject)
{
return getDOMConstructor<JSSQLTransactionConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
}
EncodedJSValue JSC_HOST_CALL jsSQLTransactionPrototypeFunctionExecuteSql(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSSQLTransaction*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "SQLTransaction", "executeSql");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSSQLTransaction::info());
return JSValue::encode(castedThis->executeSql(*state));
}
bool JSSQLTransactionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
UNUSED_PARAM(handle);
UNUSED_PARAM(visitor);
return false;
}
void JSSQLTransactionOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
auto* jsSQLTransaction = jsCast<JSSQLTransaction*>(handle.slot()->asCell());
auto& world = *static_cast<DOMWrapperWorld*>(context);
uncacheWrapper(world, &jsSQLTransaction->wrapped(), jsSQLTransaction);
}
JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<SQLTransaction>&& impl)
{
return createWrapper<SQLTransaction>(globalObject, WTFMove(impl));
}
JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, SQLTransaction& impl)
{
return wrap(state, globalObject, impl);
}
SQLTransaction* JSSQLTransaction::toWrapped(JSC::JSValue value)
{
if (auto* wrapper = jsDynamicCast<JSSQLTransaction*>(value))
return &wrapper->wrapped();
return nullptr;
}
}