WebCore/generated/JSDatabaseSync.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 "JSDatabaseSync.h"
       
    26 
       
    27 #include "DatabaseSync.h"
       
    28 #include "KURL.h"
       
    29 #include <runtime/Error.h>
       
    30 #include <runtime/JSString.h>
       
    31 #include <wtf/GetPtr.h>
       
    32 
       
    33 using namespace JSC;
       
    34 
       
    35 namespace WebCore {
       
    36 
       
    37 ASSERT_CLASS_FITS_IN_CELL(JSDatabaseSync);
       
    38 
       
    39 /* Hash table */
       
    40 #if ENABLE(JIT)
       
    41 #define THUNK_GENERATOR(generator) , generator
       
    42 #else
       
    43 #define THUNK_GENERATOR(generator)
       
    44 #endif
       
    45 
       
    46 static const HashTableValue JSDatabaseSyncTableValues[2] =
       
    47 {
       
    48     { "version", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDatabaseSyncVersion), (intptr_t)0 THUNK_GENERATOR(0) },
       
    49     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    50 };
       
    51 
       
    52 #undef THUNK_GENERATOR
       
    53 static JSC_CONST_HASHTABLE HashTable JSDatabaseSyncTable = { 2, 1, JSDatabaseSyncTableValues, 0 };
       
    54 /* Hash table for prototype */
       
    55 #if ENABLE(JIT)
       
    56 #define THUNK_GENERATOR(generator) , generator
       
    57 #else
       
    58 #define THUNK_GENERATOR(generator)
       
    59 #endif
       
    60 
       
    61 static const HashTableValue JSDatabaseSyncPrototypeTableValues[4] =
       
    62 {
       
    63     { "changeVersion", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDatabaseSyncPrototypeFunctionChangeVersion), (intptr_t)3 THUNK_GENERATOR(0) },
       
    64     { "transaction", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDatabaseSyncPrototypeFunctionTransaction), (intptr_t)1 THUNK_GENERATOR(0) },
       
    65     { "readTransaction", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDatabaseSyncPrototypeFunctionReadTransaction), (intptr_t)1 THUNK_GENERATOR(0) },
       
    66     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    67 };
       
    68 
       
    69 #undef THUNK_GENERATOR
       
    70 static JSC_CONST_HASHTABLE HashTable JSDatabaseSyncPrototypeTable = { 8, 7, JSDatabaseSyncPrototypeTableValues, 0 };
       
    71 static const HashTable* getJSDatabaseSyncPrototypeTable(ExecState* exec)
       
    72 {
       
    73     return getHashTableForGlobalData(exec->globalData(), &JSDatabaseSyncPrototypeTable);
       
    74 }
       
    75 const ClassInfo JSDatabaseSyncPrototype::s_info = { "DatabaseSyncPrototype", 0, 0, getJSDatabaseSyncPrototypeTable };
       
    76 
       
    77 JSObject* JSDatabaseSyncPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
    78 {
       
    79     return getDOMPrototype<JSDatabaseSync>(exec, globalObject);
       
    80 }
       
    81 
       
    82 bool JSDatabaseSyncPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    83 {
       
    84     return getStaticFunctionSlot<JSObject>(exec, getJSDatabaseSyncPrototypeTable(exec), this, propertyName, slot);
       
    85 }
       
    86 
       
    87 bool JSDatabaseSyncPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
    88 {
       
    89     return getStaticFunctionDescriptor<JSObject>(exec, getJSDatabaseSyncPrototypeTable(exec), this, propertyName, descriptor);
       
    90 }
       
    91 
       
    92 static const HashTable* getJSDatabaseSyncTable(ExecState* exec)
       
    93 {
       
    94     return getHashTableForGlobalData(exec->globalData(), &JSDatabaseSyncTable);
       
    95 }
       
    96 const ClassInfo JSDatabaseSync::s_info = { "DatabaseSync", 0, 0, getJSDatabaseSyncTable };
       
    97 
       
    98 JSDatabaseSync::JSDatabaseSync(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<DatabaseSync> impl)
       
    99     : DOMObjectWithGlobalPointer(structure, globalObject)
       
   100     , m_impl(impl)
       
   101 {
       
   102 }
       
   103 
       
   104 JSDatabaseSync::~JSDatabaseSync()
       
   105 {
       
   106     forgetDOMObject(this, impl());
       
   107 }
       
   108 
       
   109 JSObject* JSDatabaseSync::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   110 {
       
   111     return new (exec) JSDatabaseSyncPrototype(globalObject, JSDatabaseSyncPrototype::createStructure(globalObject->objectPrototype()));
       
   112 }
       
   113 
       
   114 bool JSDatabaseSync::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   115 {
       
   116     return getStaticValueSlot<JSDatabaseSync, Base>(exec, getJSDatabaseSyncTable(exec), this, propertyName, slot);
       
   117 }
       
   118 
       
   119 bool JSDatabaseSync::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   120 {
       
   121     return getStaticValueDescriptor<JSDatabaseSync, Base>(exec, getJSDatabaseSyncTable(exec), this, propertyName, descriptor);
       
   122 }
       
   123 
       
   124 JSValue jsDatabaseSyncVersion(ExecState* exec, JSValue slotBase, const Identifier&)
       
   125 {
       
   126     JSDatabaseSync* castedThis = static_cast<JSDatabaseSync*>(asObject(slotBase));
       
   127     UNUSED_PARAM(exec);
       
   128     DatabaseSync* imp = static_cast<DatabaseSync*>(castedThis->impl());
       
   129     JSValue result = jsString(exec, imp->version());
       
   130     return result;
       
   131 }
       
   132 
       
   133 EncodedJSValue JSC_HOST_CALL jsDatabaseSyncPrototypeFunctionChangeVersion(ExecState* exec)
       
   134 {
       
   135     JSValue thisValue = exec->hostThisValue();
       
   136     if (!thisValue.inherits(&JSDatabaseSync::s_info))
       
   137         return throwVMTypeError(exec);
       
   138     JSDatabaseSync* castedThis = static_cast<JSDatabaseSync*>(asObject(thisValue));
       
   139     return JSValue::encode(castedThis->changeVersion(exec));
       
   140 }
       
   141 
       
   142 EncodedJSValue JSC_HOST_CALL jsDatabaseSyncPrototypeFunctionTransaction(ExecState* exec)
       
   143 {
       
   144     JSValue thisValue = exec->hostThisValue();
       
   145     if (!thisValue.inherits(&JSDatabaseSync::s_info))
       
   146         return throwVMTypeError(exec);
       
   147     JSDatabaseSync* castedThis = static_cast<JSDatabaseSync*>(asObject(thisValue));
       
   148     return JSValue::encode(castedThis->transaction(exec));
       
   149 }
       
   150 
       
   151 EncodedJSValue JSC_HOST_CALL jsDatabaseSyncPrototypeFunctionReadTransaction(ExecState* exec)
       
   152 {
       
   153     JSValue thisValue = exec->hostThisValue();
       
   154     if (!thisValue.inherits(&JSDatabaseSync::s_info))
       
   155         return throwVMTypeError(exec);
       
   156     JSDatabaseSync* castedThis = static_cast<JSDatabaseSync*>(asObject(thisValue));
       
   157     return JSValue::encode(castedThis->readTransaction(exec));
       
   158 }
       
   159 
       
   160 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DatabaseSync* object)
       
   161 {
       
   162     return getDOMObjectWrapper<JSDatabaseSync>(exec, globalObject, object);
       
   163 }
       
   164 DatabaseSync* toDatabaseSync(JSC::JSValue value)
       
   165 {
       
   166     return value.inherits(&JSDatabaseSync::s_info) ? static_cast<JSDatabaseSync*>(asObject(value))->impl() : 0;
       
   167 }
       
   168 
       
   169 }
       
   170 
       
   171 #endif // ENABLE(DATABASE)