WebCore/generated/JSMediaError.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(VIDEO)
       
    24 
       
    25 #include "JSMediaError.h"
       
    26 
       
    27 #include "MediaError.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(JSMediaError);
       
    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 JSMediaErrorTableValues[3] =
       
    45 {
       
    46     { "code", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMediaErrorCode), (intptr_t)0 THUNK_GENERATOR(0) },
       
    47     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMediaErrorConstructor), (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 JSMediaErrorTable = { 5, 3, JSMediaErrorTableValues, 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 JSMediaErrorConstructorTableValues[5] =
       
    61 {
       
    62     { "MEDIA_ERR_ABORTED", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMediaErrorMEDIA_ERR_ABORTED), (intptr_t)0 THUNK_GENERATOR(0) },
       
    63     { "MEDIA_ERR_NETWORK", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMediaErrorMEDIA_ERR_NETWORK), (intptr_t)0 THUNK_GENERATOR(0) },
       
    64     { "MEDIA_ERR_DECODE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMediaErrorMEDIA_ERR_DECODE), (intptr_t)0 THUNK_GENERATOR(0) },
       
    65     { "MEDIA_ERR_SRC_NOT_SUPPORTED", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMediaErrorMEDIA_ERR_SRC_NOT_SUPPORTED), (intptr_t)0 THUNK_GENERATOR(0) },
       
    66     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    67 };
       
    68 
       
    69 #undef THUNK_GENERATOR
       
    70 static JSC_CONST_HASHTABLE HashTable JSMediaErrorConstructorTable = { 9, 7, JSMediaErrorConstructorTableValues, 0 };
       
    71 
       
    72 COMPILE_ASSERT(1 == MediaError::MEDIA_ERR_ABORTED, MediaErrorEnumMEDIA_ERR_ABORTEDIsWrongUseDontCheckEnums);
       
    73 COMPILE_ASSERT(2 == MediaError::MEDIA_ERR_NETWORK, MediaErrorEnumMEDIA_ERR_NETWORKIsWrongUseDontCheckEnums);
       
    74 COMPILE_ASSERT(3 == MediaError::MEDIA_ERR_DECODE, MediaErrorEnumMEDIA_ERR_DECODEIsWrongUseDontCheckEnums);
       
    75 COMPILE_ASSERT(4 == MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED, MediaErrorEnumMEDIA_ERR_SRC_NOT_SUPPORTEDIsWrongUseDontCheckEnums);
       
    76 
       
    77 class JSMediaErrorConstructor : public DOMConstructorObject {
       
    78 public:
       
    79     JSMediaErrorConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
    80 
       
    81     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
    82     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
    83     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
    84     static const JSC::ClassInfo s_info;
       
    85     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
    86     {
       
    87         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
    88     }
       
    89 protected:
       
    90     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
    91 };
       
    92 
       
    93 const ClassInfo JSMediaErrorConstructor::s_info = { "MediaErrorConstructor", 0, &JSMediaErrorConstructorTable, 0 };
       
    94 
       
    95 JSMediaErrorConstructor::JSMediaErrorConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
    96     : DOMConstructorObject(JSMediaErrorConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
    97 {
       
    98     putDirect(exec->propertyNames().prototype, JSMediaErrorPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
    99 }
       
   100 
       
   101 bool JSMediaErrorConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   102 {
       
   103     return getStaticValueSlot<JSMediaErrorConstructor, DOMObject>(exec, &JSMediaErrorConstructorTable, this, propertyName, slot);
       
   104 }
       
   105 
       
   106 bool JSMediaErrorConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   107 {
       
   108     return getStaticValueDescriptor<JSMediaErrorConstructor, DOMObject>(exec, &JSMediaErrorConstructorTable, this, propertyName, descriptor);
       
   109 }
       
   110 
       
   111 /* Hash table for prototype */
       
   112 #if ENABLE(JIT)
       
   113 #define THUNK_GENERATOR(generator) , generator
       
   114 #else
       
   115 #define THUNK_GENERATOR(generator)
       
   116 #endif
       
   117 
       
   118 static const HashTableValue JSMediaErrorPrototypeTableValues[5] =
       
   119 {
       
   120     { "MEDIA_ERR_ABORTED", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMediaErrorMEDIA_ERR_ABORTED), (intptr_t)0 THUNK_GENERATOR(0) },
       
   121     { "MEDIA_ERR_NETWORK", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMediaErrorMEDIA_ERR_NETWORK), (intptr_t)0 THUNK_GENERATOR(0) },
       
   122     { "MEDIA_ERR_DECODE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMediaErrorMEDIA_ERR_DECODE), (intptr_t)0 THUNK_GENERATOR(0) },
       
   123     { "MEDIA_ERR_SRC_NOT_SUPPORTED", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMediaErrorMEDIA_ERR_SRC_NOT_SUPPORTED), (intptr_t)0 THUNK_GENERATOR(0) },
       
   124     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   125 };
       
   126 
       
   127 #undef THUNK_GENERATOR
       
   128 static JSC_CONST_HASHTABLE HashTable JSMediaErrorPrototypeTable = { 9, 7, JSMediaErrorPrototypeTableValues, 0 };
       
   129 const ClassInfo JSMediaErrorPrototype::s_info = { "MediaErrorPrototype", 0, &JSMediaErrorPrototypeTable, 0 };
       
   130 
       
   131 JSObject* JSMediaErrorPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   132 {
       
   133     return getDOMPrototype<JSMediaError>(exec, globalObject);
       
   134 }
       
   135 
       
   136 bool JSMediaErrorPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   137 {
       
   138     return getStaticValueSlot<JSMediaErrorPrototype, JSObject>(exec, &JSMediaErrorPrototypeTable, this, propertyName, slot);
       
   139 }
       
   140 
       
   141 bool JSMediaErrorPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   142 {
       
   143     return getStaticValueDescriptor<JSMediaErrorPrototype, JSObject>(exec, &JSMediaErrorPrototypeTable, this, propertyName, descriptor);
       
   144 }
       
   145 
       
   146 const ClassInfo JSMediaError::s_info = { "MediaError", 0, &JSMediaErrorTable, 0 };
       
   147 
       
   148 JSMediaError::JSMediaError(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<MediaError> impl)
       
   149     : DOMObjectWithGlobalPointer(structure, globalObject)
       
   150     , m_impl(impl)
       
   151 {
       
   152 }
       
   153 
       
   154 JSMediaError::~JSMediaError()
       
   155 {
       
   156     forgetDOMObject(this, impl());
       
   157 }
       
   158 
       
   159 JSObject* JSMediaError::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   160 {
       
   161     return new (exec) JSMediaErrorPrototype(globalObject, JSMediaErrorPrototype::createStructure(globalObject->objectPrototype()));
       
   162 }
       
   163 
       
   164 bool JSMediaError::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   165 {
       
   166     return getStaticValueSlot<JSMediaError, Base>(exec, &JSMediaErrorTable, this, propertyName, slot);
       
   167 }
       
   168 
       
   169 bool JSMediaError::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   170 {
       
   171     return getStaticValueDescriptor<JSMediaError, Base>(exec, &JSMediaErrorTable, this, propertyName, descriptor);
       
   172 }
       
   173 
       
   174 JSValue jsMediaErrorCode(ExecState* exec, JSValue slotBase, const Identifier&)
       
   175 {
       
   176     JSMediaError* castedThis = static_cast<JSMediaError*>(asObject(slotBase));
       
   177     UNUSED_PARAM(exec);
       
   178     MediaError* imp = static_cast<MediaError*>(castedThis->impl());
       
   179     JSValue result = jsNumber(exec, imp->code());
       
   180     return result;
       
   181 }
       
   182 
       
   183 JSValue jsMediaErrorConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   184 {
       
   185     JSMediaError* domObject = static_cast<JSMediaError*>(asObject(slotBase));
       
   186     return JSMediaError::getConstructor(exec, domObject->globalObject());
       
   187 }
       
   188 JSValue JSMediaError::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   189 {
       
   190     return getDOMConstructor<JSMediaErrorConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   191 }
       
   192 
       
   193 // Constant getters
       
   194 
       
   195 JSValue jsMediaErrorMEDIA_ERR_ABORTED(ExecState* exec, JSValue, const Identifier&)
       
   196 {
       
   197     return jsNumber(exec, static_cast<int>(1));
       
   198 }
       
   199 
       
   200 JSValue jsMediaErrorMEDIA_ERR_NETWORK(ExecState* exec, JSValue, const Identifier&)
       
   201 {
       
   202     return jsNumber(exec, static_cast<int>(2));
       
   203 }
       
   204 
       
   205 JSValue jsMediaErrorMEDIA_ERR_DECODE(ExecState* exec, JSValue, const Identifier&)
       
   206 {
       
   207     return jsNumber(exec, static_cast<int>(3));
       
   208 }
       
   209 
       
   210 JSValue jsMediaErrorMEDIA_ERR_SRC_NOT_SUPPORTED(ExecState* exec, JSValue, const Identifier&)
       
   211 {
       
   212     return jsNumber(exec, static_cast<int>(4));
       
   213 }
       
   214 
       
   215 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, MediaError* object)
       
   216 {
       
   217     return getDOMObjectWrapper<JSMediaError>(exec, globalObject, object);
       
   218 }
       
   219 MediaError* toMediaError(JSC::JSValue value)
       
   220 {
       
   221     return value.inherits(&JSMediaError::s_info) ? static_cast<JSMediaError*>(asObject(value))->impl() : 0;
       
   222 }
       
   223 
       
   224 }
       
   225 
       
   226 #endif // ENABLE(VIDEO)