WebCore/generated/JSFileError.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(FILE_READER) || ENABLE(FILE_WRITER)
       
    24 
       
    25 #include "JSFileError.h"
       
    26 
       
    27 #include "FileError.h"
       
    28 #include <runtime/JSNumberCell.h>
       
    29 #include <wtf/GetPtr.h>
       
    30 
       
    31 using namespace JSC;
       
    32 
       
    33 namespace WebCore {
       
    34 
       
    35 ASSERT_CLASS_FITS_IN_CELL(JSFileError);
       
    36 
       
    37 /* Hash table */
       
    38 #if ENABLE(JIT)
       
    39 #define THUNK_GENERATOR(generator) , generator
       
    40 #else
       
    41 #define THUNK_GENERATOR(generator)
       
    42 #endif
       
    43 
       
    44 static const HashTableValue JSFileErrorTableValues[3] =
       
    45 {
       
    46     { "code", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsFileErrorCode), (intptr_t)0 THUNK_GENERATOR(0) },
       
    47     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsFileErrorConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
    48     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    49 };
       
    50 
       
    51 #undef THUNK_GENERATOR
       
    52 static JSC_CONST_HASHTABLE HashTable JSFileErrorTable = { 5, 3, JSFileErrorTableValues, 0 };
       
    53 /* Hash table for constructor */
       
    54 #if ENABLE(JIT)
       
    55 #define THUNK_GENERATOR(generator) , generator
       
    56 #else
       
    57 #define THUNK_GENERATOR(generator)
       
    58 #endif
       
    59 
       
    60 static const HashTableValue JSFileErrorConstructorTableValues[7] =
       
    61 {
       
    62     { "NO_MODIFICATION_ALLOWED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsFileErrorNO_MODIFICATION_ALLOWED_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
       
    63     { "NOT_FOUND_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsFileErrorNOT_FOUND_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
       
    64     { "SECURITY_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsFileErrorSECURITY_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
       
    65     { "ABORT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsFileErrorABORT_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
       
    66     { "NOT_READABLE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsFileErrorNOT_READABLE_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
       
    67     { "ENCODING_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsFileErrorENCODING_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
       
    68     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    69 };
       
    70 
       
    71 #undef THUNK_GENERATOR
       
    72 static JSC_CONST_HASHTABLE HashTable JSFileErrorConstructorTable = { 17, 15, JSFileErrorConstructorTableValues, 0 };
       
    73 class JSFileErrorConstructor : public DOMConstructorObject {
       
    74 public:
       
    75     JSFileErrorConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
    76 
       
    77     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
    78     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
    79     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
    80     static const JSC::ClassInfo s_info;
       
    81     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
    82     {
       
    83         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
    84     }
       
    85 protected:
       
    86     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
    87 };
       
    88 
       
    89 const ClassInfo JSFileErrorConstructor::s_info = { "FileErrorConstructor", 0, &JSFileErrorConstructorTable, 0 };
       
    90 
       
    91 JSFileErrorConstructor::JSFileErrorConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
    92     : DOMConstructorObject(JSFileErrorConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
    93 {
       
    94     putDirect(exec->propertyNames().prototype, JSFileErrorPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
    95 }
       
    96 
       
    97 bool JSFileErrorConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    98 {
       
    99     return getStaticValueSlot<JSFileErrorConstructor, DOMObject>(exec, &JSFileErrorConstructorTable, this, propertyName, slot);
       
   100 }
       
   101 
       
   102 bool JSFileErrorConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   103 {
       
   104     return getStaticValueDescriptor<JSFileErrorConstructor, DOMObject>(exec, &JSFileErrorConstructorTable, this, propertyName, descriptor);
       
   105 }
       
   106 
       
   107 /* Hash table for prototype */
       
   108 #if ENABLE(JIT)
       
   109 #define THUNK_GENERATOR(generator) , generator
       
   110 #else
       
   111 #define THUNK_GENERATOR(generator)
       
   112 #endif
       
   113 
       
   114 static const HashTableValue JSFileErrorPrototypeTableValues[7] =
       
   115 {
       
   116     { "NO_MODIFICATION_ALLOWED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsFileErrorNO_MODIFICATION_ALLOWED_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
       
   117     { "NOT_FOUND_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsFileErrorNOT_FOUND_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
       
   118     { "SECURITY_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsFileErrorSECURITY_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
       
   119     { "ABORT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsFileErrorABORT_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
       
   120     { "NOT_READABLE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsFileErrorNOT_READABLE_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
       
   121     { "ENCODING_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsFileErrorENCODING_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
       
   122     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   123 };
       
   124 
       
   125 #undef THUNK_GENERATOR
       
   126 static JSC_CONST_HASHTABLE HashTable JSFileErrorPrototypeTable = { 17, 15, JSFileErrorPrototypeTableValues, 0 };
       
   127 const ClassInfo JSFileErrorPrototype::s_info = { "FileErrorPrototype", 0, &JSFileErrorPrototypeTable, 0 };
       
   128 
       
   129 JSObject* JSFileErrorPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   130 {
       
   131     return getDOMPrototype<JSFileError>(exec, globalObject);
       
   132 }
       
   133 
       
   134 bool JSFileErrorPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   135 {
       
   136     return getStaticValueSlot<JSFileErrorPrototype, JSObject>(exec, &JSFileErrorPrototypeTable, this, propertyName, slot);
       
   137 }
       
   138 
       
   139 bool JSFileErrorPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   140 {
       
   141     return getStaticValueDescriptor<JSFileErrorPrototype, JSObject>(exec, &JSFileErrorPrototypeTable, this, propertyName, descriptor);
       
   142 }
       
   143 
       
   144 const ClassInfo JSFileError::s_info = { "FileError", 0, &JSFileErrorTable, 0 };
       
   145 
       
   146 JSFileError::JSFileError(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<FileError> impl)
       
   147     : DOMObjectWithGlobalPointer(structure, globalObject)
       
   148     , m_impl(impl)
       
   149 {
       
   150 }
       
   151 
       
   152 JSFileError::~JSFileError()
       
   153 {
       
   154     forgetDOMObject(this, impl());
       
   155 }
       
   156 
       
   157 JSObject* JSFileError::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   158 {
       
   159     return new (exec) JSFileErrorPrototype(globalObject, JSFileErrorPrototype::createStructure(globalObject->objectPrototype()));
       
   160 }
       
   161 
       
   162 bool JSFileError::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   163 {
       
   164     return getStaticValueSlot<JSFileError, Base>(exec, &JSFileErrorTable, this, propertyName, slot);
       
   165 }
       
   166 
       
   167 bool JSFileError::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   168 {
       
   169     return getStaticValueDescriptor<JSFileError, Base>(exec, &JSFileErrorTable, this, propertyName, descriptor);
       
   170 }
       
   171 
       
   172 JSValue jsFileErrorCode(ExecState* exec, JSValue slotBase, const Identifier&)
       
   173 {
       
   174     JSFileError* castedThis = static_cast<JSFileError*>(asObject(slotBase));
       
   175     UNUSED_PARAM(exec);
       
   176     FileError* imp = static_cast<FileError*>(castedThis->impl());
       
   177     JSValue result = jsNumber(exec, imp->code());
       
   178     return result;
       
   179 }
       
   180 
       
   181 JSValue jsFileErrorConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   182 {
       
   183     JSFileError* domObject = static_cast<JSFileError*>(asObject(slotBase));
       
   184     return JSFileError::getConstructor(exec, domObject->globalObject());
       
   185 }
       
   186 JSValue JSFileError::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   187 {
       
   188     return getDOMConstructor<JSFileErrorConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   189 }
       
   190 
       
   191 // Constant getters
       
   192 
       
   193 JSValue jsFileErrorNO_MODIFICATION_ALLOWED_ERR(ExecState* exec, JSValue, const Identifier&)
       
   194 {
       
   195     return jsNumber(exec, static_cast<int>(7));
       
   196 }
       
   197 
       
   198 JSValue jsFileErrorNOT_FOUND_ERR(ExecState* exec, JSValue, const Identifier&)
       
   199 {
       
   200     return jsNumber(exec, static_cast<int>(8));
       
   201 }
       
   202 
       
   203 JSValue jsFileErrorSECURITY_ERR(ExecState* exec, JSValue, const Identifier&)
       
   204 {
       
   205     return jsNumber(exec, static_cast<int>(18));
       
   206 }
       
   207 
       
   208 JSValue jsFileErrorABORT_ERR(ExecState* exec, JSValue, const Identifier&)
       
   209 {
       
   210     return jsNumber(exec, static_cast<int>(20));
       
   211 }
       
   212 
       
   213 JSValue jsFileErrorNOT_READABLE_ERR(ExecState* exec, JSValue, const Identifier&)
       
   214 {
       
   215     return jsNumber(exec, static_cast<int>(24));
       
   216 }
       
   217 
       
   218 JSValue jsFileErrorENCODING_ERR(ExecState* exec, JSValue, const Identifier&)
       
   219 {
       
   220     return jsNumber(exec, static_cast<int>(26));
       
   221 }
       
   222 
       
   223 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, FileError* object)
       
   224 {
       
   225     return getDOMObjectWrapper<JSFileError>(exec, globalObject, object);
       
   226 }
       
   227 FileError* toFileError(JSC::JSValue value)
       
   228 {
       
   229     return value.inherits(&JSFileError::s_info) ? static_cast<JSFileError*>(asObject(value))->impl() : 0;
       
   230 }
       
   231 
       
   232 }
       
   233 
       
   234 #endif // ENABLE(FILE_READER) || ENABLE(FILE_WRITER)