WebCore/generated/JSSQLTransaction.cpp
changeset 0 4f2f89ce4247
equal deleted inserted replaced
-1:000000000000 0:4f2f89ce4247
       
     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(DATABASE)
       
    24 
       
    25 #include "JSSQLTransaction.h"
       
    26 
       
    27 #include "SQLTransaction.h"
       
    28 #include <runtime/Error.h>
       
    29 #include <wtf/GetPtr.h>
       
    30 
       
    31 using namespace JSC;
       
    32 
       
    33 namespace WebCore {
       
    34 
       
    35 ASSERT_CLASS_FITS_IN_CELL(JSSQLTransaction);
       
    36 
       
    37 /* Hash table for prototype */
       
    38 #if ENABLE(JIT)
       
    39 #define THUNK_GENERATOR(generator) , generator
       
    40 #else
       
    41 #define THUNK_GENERATOR(generator)
       
    42 #endif
       
    43 
       
    44 static const HashTableValue JSSQLTransactionPrototypeTableValues[2] =
       
    45 {
       
    46     { "executeSql", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSQLTransactionPrototypeFunctionExecuteSql), (intptr_t)4 THUNK_GENERATOR(0) },
       
    47     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    48 };
       
    49 
       
    50 #undef THUNK_GENERATOR
       
    51 static JSC_CONST_HASHTABLE HashTable JSSQLTransactionPrototypeTable = { 2, 1, JSSQLTransactionPrototypeTableValues, 0 };
       
    52 static const HashTable* getJSSQLTransactionPrototypeTable(ExecState* exec)
       
    53 {
       
    54     return getHashTableForGlobalData(exec->globalData(), &JSSQLTransactionPrototypeTable);
       
    55 }
       
    56 const ClassInfo JSSQLTransactionPrototype::s_info = { "SQLTransactionPrototype", 0, 0, getJSSQLTransactionPrototypeTable };
       
    57 
       
    58 JSObject* JSSQLTransactionPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
    59 {
       
    60     return getDOMPrototype<JSSQLTransaction>(exec, globalObject);
       
    61 }
       
    62 
       
    63 bool JSSQLTransactionPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    64 {
       
    65     return getStaticFunctionSlot<JSObject>(exec, getJSSQLTransactionPrototypeTable(exec), this, propertyName, slot);
       
    66 }
       
    67 
       
    68 bool JSSQLTransactionPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
    69 {
       
    70     return getStaticFunctionDescriptor<JSObject>(exec, getJSSQLTransactionPrototypeTable(exec), this, propertyName, descriptor);
       
    71 }
       
    72 
       
    73 const ClassInfo JSSQLTransaction::s_info = { "SQLTransaction", 0, 0, 0 };
       
    74 
       
    75 JSSQLTransaction::JSSQLTransaction(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SQLTransaction> impl)
       
    76     : DOMObjectWithGlobalPointer(structure, globalObject)
       
    77     , m_impl(impl)
       
    78 {
       
    79 }
       
    80 
       
    81 JSSQLTransaction::~JSSQLTransaction()
       
    82 {
       
    83     forgetDOMObject(this, impl());
       
    84 }
       
    85 
       
    86 JSObject* JSSQLTransaction::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
    87 {
       
    88     return new (exec) JSSQLTransactionPrototype(globalObject, JSSQLTransactionPrototype::createStructure(globalObject->objectPrototype()));
       
    89 }
       
    90 
       
    91 EncodedJSValue JSC_HOST_CALL jsSQLTransactionPrototypeFunctionExecuteSql(ExecState* exec)
       
    92 {
       
    93     JSValue thisValue = exec->hostThisValue();
       
    94     if (!thisValue.inherits(&JSSQLTransaction::s_info))
       
    95         return throwVMTypeError(exec);
       
    96     JSSQLTransaction* castedThis = static_cast<JSSQLTransaction*>(asObject(thisValue));
       
    97     return JSValue::encode(castedThis->executeSql(exec));
       
    98 }
       
    99 
       
   100 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SQLTransaction* object)
       
   101 {
       
   102     return getDOMObjectWrapper<JSSQLTransaction>(exec, globalObject, object);
       
   103 }
       
   104 SQLTransaction* toSQLTransaction(JSC::JSValue value)
       
   105 {
       
   106     return value.inherits(&JSSQLTransaction::s_info) ? static_cast<JSSQLTransaction*>(asObject(value))->impl() : 0;
       
   107 }
       
   108 
       
   109 }
       
   110 
       
   111 #endif // ENABLE(DATABASE)