/* This file is part of the WebKit open source project. This file has been generated by generate-bindings.pl. DO NOT MODIFY! This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "JSArrayBufferView.h" #include "ArrayBuffer.h" #include "ArrayBufferView.h" #include "JSArrayBuffer.h" #include using namespace JSC; namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSArrayBufferView); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSArrayBufferViewTableValues[4] = { { "buffer", DontDelete | ReadOnly, (intptr_t)static_cast(jsArrayBufferViewBuffer), (intptr_t)0 THUNK_GENERATOR(0) }, { "byteOffset", DontDelete | ReadOnly, (intptr_t)static_cast(jsArrayBufferViewByteOffset), (intptr_t)0 THUNK_GENERATOR(0) }, { "byteLength", DontDelete | ReadOnly, (intptr_t)static_cast(jsArrayBufferViewByteLength), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSArrayBufferViewTable = { 8, 7, JSArrayBufferViewTableValues, 0 }; /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSArrayBufferViewPrototypeTableValues[1] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSArrayBufferViewPrototypeTable = { 1, 0, JSArrayBufferViewPrototypeTableValues, 0 }; static const HashTable* getJSArrayBufferViewPrototypeTable(ExecState* exec) { return getHashTableForGlobalData(exec->globalData(), &JSArrayBufferViewPrototypeTable); } const ClassInfo JSArrayBufferViewPrototype::s_info = { "ArrayBufferViewPrototype", &JSC::JSObjectWithGlobalObject::s_info, 0, getJSArrayBufferViewPrototypeTable }; JSObject* JSArrayBufferViewPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype(exec, globalObject); } static const HashTable* getJSArrayBufferViewTable(ExecState* exec) { return getHashTableForGlobalData(exec->globalData(), &JSArrayBufferViewTable); } const ClassInfo JSArrayBufferView::s_info = { "ArrayBufferView", &JSDOMWrapper::s_info, 0, getJSArrayBufferViewTable }; JSArrayBufferView::JSArrayBufferView(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr impl) : JSDOMWrapper(structure, globalObject) , m_impl(impl) { ASSERT(inherits(&s_info)); } JSObject* JSArrayBufferView::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSArrayBufferViewPrototype(exec->globalData(), globalObject, JSArrayBufferViewPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype())); } bool JSArrayBufferView::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot(exec, getJSArrayBufferViewTable(exec), this, propertyName, slot); } bool JSArrayBufferView::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor(exec, getJSArrayBufferViewTable(exec), this, propertyName, descriptor); } JSValue jsArrayBufferViewBuffer(ExecState* exec, JSValue slotBase, const Identifier&) { JSArrayBufferView* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); ArrayBufferView* imp = static_cast(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->buffer())); return result; } JSValue jsArrayBufferViewByteOffset(ExecState* exec, JSValue slotBase, const Identifier&) { JSArrayBufferView* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); ArrayBufferView* imp = static_cast(castedThis->impl()); JSValue result = jsNumber(imp->byteOffset()); return result; } JSValue jsArrayBufferViewByteLength(ExecState* exec, JSValue slotBase, const Identifier&) { JSArrayBufferView* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); ArrayBufferView* imp = static_cast(castedThis->impl()); JSValue result = jsNumber(imp->byteLength()); return result; } ArrayBufferView* toArrayBufferView(JSC::JSValue value) { return value.inherits(&JSArrayBufferView::s_info) ? static_cast(asObject(value))->impl() : 0; } }