WebCore/generated/JSDOMFormData.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 #include "JSDOMFormData.h"
       
    23 
       
    24 #include "DOMFormData.h"
       
    25 #include <runtime/Error.h>
       
    26 #include <wtf/GetPtr.h>
       
    27 
       
    28 using namespace JSC;
       
    29 
       
    30 namespace WebCore {
       
    31 
       
    32 ASSERT_CLASS_FITS_IN_CELL(JSDOMFormData);
       
    33 
       
    34 /* Hash table */
       
    35 #if ENABLE(JIT)
       
    36 #define THUNK_GENERATOR(generator) , generator
       
    37 #else
       
    38 #define THUNK_GENERATOR(generator)
       
    39 #endif
       
    40 
       
    41 static const HashTableValue JSDOMFormDataTableValues[2] =
       
    42 {
       
    43     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMFormDataConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
    44     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    45 };
       
    46 
       
    47 #undef THUNK_GENERATOR
       
    48 static JSC_CONST_HASHTABLE HashTable JSDOMFormDataTable = { 2, 1, JSDOMFormDataTableValues, 0 };
       
    49 /* Hash table for constructor */
       
    50 #if ENABLE(JIT)
       
    51 #define THUNK_GENERATOR(generator) , generator
       
    52 #else
       
    53 #define THUNK_GENERATOR(generator)
       
    54 #endif
       
    55 
       
    56 static const HashTableValue JSDOMFormDataConstructorTableValues[1] =
       
    57 {
       
    58     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    59 };
       
    60 
       
    61 #undef THUNK_GENERATOR
       
    62 static JSC_CONST_HASHTABLE HashTable JSDOMFormDataConstructorTable = { 1, 0, JSDOMFormDataConstructorTableValues, 0 };
       
    63 class JSDOMFormDataConstructor : public DOMConstructorObject {
       
    64 public:
       
    65     JSDOMFormDataConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
    66 
       
    67     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
    68     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
    69     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
    70     static const JSC::ClassInfo s_info;
       
    71     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
    72     {
       
    73         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
    74     }
       
    75 protected:
       
    76     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
    77     static JSC::EncodedJSValue JSC_HOST_CALL constructJSDOMFormData(JSC::ExecState*);
       
    78     virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
       
    79 };
       
    80 
       
    81 const ClassInfo JSDOMFormDataConstructor::s_info = { "FormDataConstructor", 0, &JSDOMFormDataConstructorTable, 0 };
       
    82 
       
    83 JSDOMFormDataConstructor::JSDOMFormDataConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
    84     : DOMConstructorObject(JSDOMFormDataConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
    85 {
       
    86     putDirect(exec->propertyNames().prototype, JSDOMFormDataPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
    87 }
       
    88 
       
    89 bool JSDOMFormDataConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    90 {
       
    91     return getStaticValueSlot<JSDOMFormDataConstructor, DOMObject>(exec, &JSDOMFormDataConstructorTable, this, propertyName, slot);
       
    92 }
       
    93 
       
    94 bool JSDOMFormDataConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
    95 {
       
    96     return getStaticValueDescriptor<JSDOMFormDataConstructor, DOMObject>(exec, &JSDOMFormDataConstructorTable, this, propertyName, descriptor);
       
    97 }
       
    98 
       
    99 EncodedJSValue JSC_HOST_CALL JSDOMFormDataConstructor::constructJSDOMFormData(ExecState* exec)
       
   100 {
       
   101     return JSValue::encode(asObject(toJS(exec, static_cast<JSDOMFormDataConstructor*>(exec->callee())->globalObject(), DOMFormData::create())));
       
   102 }
       
   103 
       
   104 ConstructType JSDOMFormDataConstructor::getConstructData(ConstructData& constructData)
       
   105 {
       
   106     constructData.native.function = constructJSDOMFormData;
       
   107     return ConstructTypeHost;
       
   108 }
       
   109 
       
   110 /* Hash table for prototype */
       
   111 #if ENABLE(JIT)
       
   112 #define THUNK_GENERATOR(generator) , generator
       
   113 #else
       
   114 #define THUNK_GENERATOR(generator)
       
   115 #endif
       
   116 
       
   117 static const HashTableValue JSDOMFormDataPrototypeTableValues[2] =
       
   118 {
       
   119     { "append", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDOMFormDataPrototypeFunctionAppend), (intptr_t)2 THUNK_GENERATOR(0) },
       
   120     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   121 };
       
   122 
       
   123 #undef THUNK_GENERATOR
       
   124 static JSC_CONST_HASHTABLE HashTable JSDOMFormDataPrototypeTable = { 2, 1, JSDOMFormDataPrototypeTableValues, 0 };
       
   125 const ClassInfo JSDOMFormDataPrototype::s_info = { "FormDataPrototype", 0, &JSDOMFormDataPrototypeTable, 0 };
       
   126 
       
   127 JSObject* JSDOMFormDataPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   128 {
       
   129     return getDOMPrototype<JSDOMFormData>(exec, globalObject);
       
   130 }
       
   131 
       
   132 bool JSDOMFormDataPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   133 {
       
   134     return getStaticFunctionSlot<JSObject>(exec, &JSDOMFormDataPrototypeTable, this, propertyName, slot);
       
   135 }
       
   136 
       
   137 bool JSDOMFormDataPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   138 {
       
   139     return getStaticFunctionDescriptor<JSObject>(exec, &JSDOMFormDataPrototypeTable, this, propertyName, descriptor);
       
   140 }
       
   141 
       
   142 const ClassInfo JSDOMFormData::s_info = { "FormData", 0, &JSDOMFormDataTable, 0 };
       
   143 
       
   144 JSDOMFormData::JSDOMFormData(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<DOMFormData> impl)
       
   145     : DOMObjectWithGlobalPointer(structure, globalObject)
       
   146     , m_impl(impl)
       
   147 {
       
   148 }
       
   149 
       
   150 JSDOMFormData::~JSDOMFormData()
       
   151 {
       
   152     forgetDOMObject(this, impl());
       
   153 }
       
   154 
       
   155 JSObject* JSDOMFormData::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   156 {
       
   157     return new (exec) JSDOMFormDataPrototype(globalObject, JSDOMFormDataPrototype::createStructure(globalObject->objectPrototype()));
       
   158 }
       
   159 
       
   160 bool JSDOMFormData::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   161 {
       
   162     return getStaticValueSlot<JSDOMFormData, Base>(exec, &JSDOMFormDataTable, this, propertyName, slot);
       
   163 }
       
   164 
       
   165 bool JSDOMFormData::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   166 {
       
   167     return getStaticValueDescriptor<JSDOMFormData, Base>(exec, &JSDOMFormDataTable, this, propertyName, descriptor);
       
   168 }
       
   169 
       
   170 JSValue jsDOMFormDataConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   171 {
       
   172     JSDOMFormData* domObject = static_cast<JSDOMFormData*>(asObject(slotBase));
       
   173     return JSDOMFormData::getConstructor(exec, domObject->globalObject());
       
   174 }
       
   175 JSValue JSDOMFormData::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   176 {
       
   177     return getDOMConstructor<JSDOMFormDataConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   178 }
       
   179 
       
   180 EncodedJSValue JSC_HOST_CALL jsDOMFormDataPrototypeFunctionAppend(ExecState* exec)
       
   181 {
       
   182     JSValue thisValue = exec->hostThisValue();
       
   183     if (!thisValue.inherits(&JSDOMFormData::s_info))
       
   184         return throwVMTypeError(exec);
       
   185     JSDOMFormData* castedThis = static_cast<JSDOMFormData*>(asObject(thisValue));
       
   186     return JSValue::encode(castedThis->append(exec));
       
   187 }
       
   188 
       
   189 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DOMFormData* object)
       
   190 {
       
   191     return getDOMObjectWrapper<JSDOMFormData>(exec, globalObject, object);
       
   192 }
       
   193 DOMFormData* toDOMFormData(JSC::JSValue value)
       
   194 {
       
   195     return value.inherits(&JSDOMFormData::s_info) ? static_cast<JSDOMFormData*>(asObject(value))->impl() : 0;
       
   196 }
       
   197 
       
   198 }