/*
    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 "JSXMLHttpRequestUpload.h"

#include "Event.h"
#include "EventListener.h"
#include "ExceptionCode.h"
#include "JSDOMBinding.h"
#include "JSEvent.h"
#include "JSEventListener.h"
#include "XMLHttpRequestUpload.h"
#include <runtime/Error.h>
#include <wtf/GetPtr.h>

using namespace JSC;

namespace WebCore {

/* Hash table */

static const HashTableValue JSXMLHttpRequestUploadTableValues[] =
{
    { "onabort", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestUploadOnabort), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSXMLHttpRequestUploadOnabort) },
    { "onerror", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestUploadOnerror), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSXMLHttpRequestUploadOnerror) },
    { "onload", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestUploadOnload), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSXMLHttpRequestUploadOnload) },
    { "onloadend", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestUploadOnloadend), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSXMLHttpRequestUploadOnloadend) },
    { "onloadstart", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestUploadOnloadstart), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSXMLHttpRequestUploadOnloadstart) },
    { "onprogress", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestUploadOnprogress), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSXMLHttpRequestUploadOnprogress) },
    { "constructor", DontEnum | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsXMLHttpRequestUploadConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSXMLHttpRequestUploadTable = { 17, 15, true, JSXMLHttpRequestUploadTableValues, 0 };
/* Hash table for constructor */

static const HashTableValue JSXMLHttpRequestUploadConstructorTableValues[] =
{
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSXMLHttpRequestUploadConstructorTable = { 1, 0, false, JSXMLHttpRequestUploadConstructorTableValues, 0 };
static const HashTable& getJSXMLHttpRequestUploadConstructorTable(VM& vm)
{
    return getHashTableForGlobalData(vm, JSXMLHttpRequestUploadConstructorTable);
}

const ClassInfo JSXMLHttpRequestUploadConstructor::s_info = { "XMLHttpRequestUploadConstructor", &Base::s_info, 0, getJSXMLHttpRequestUploadConstructorTable, CREATE_METHOD_TABLE(JSXMLHttpRequestUploadConstructor) };

JSXMLHttpRequestUploadConstructor::JSXMLHttpRequestUploadConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
    : DOMConstructorObject(structure, globalObject)
{
}

void JSXMLHttpRequestUploadConstructor::finishCreation(VM& vm, JSDOMGlobalObject* globalObject)
{
    Base::finishCreation(vm);
    ASSERT(inherits(info()));
    putDirect(vm, vm.propertyNames->prototype, JSXMLHttpRequestUploadPrototype::self(vm, globalObject), DontDelete | ReadOnly);
    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum);
}

bool JSXMLHttpRequestUploadConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSXMLHttpRequestUploadConstructor, JSDOMWrapper>(exec, getJSXMLHttpRequestUploadConstructorTable(exec->vm()), jsCast<JSXMLHttpRequestUploadConstructor*>(object), propertyName, slot);
}

/* Hash table for prototype */

static const HashTableValue JSXMLHttpRequestUploadPrototypeTableValues[] =
{
    { "addEventListener", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsXMLHttpRequestUploadPrototypeFunctionAddEventListener), (intptr_t) (2) },
    { "removeEventListener", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsXMLHttpRequestUploadPrototypeFunctionRemoveEventListener), (intptr_t) (2) },
    { "dispatchEvent", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsXMLHttpRequestUploadPrototypeFunctionDispatchEvent), (intptr_t) (1) },
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSXMLHttpRequestUploadPrototypeTable = { 8, 7, false, JSXMLHttpRequestUploadPrototypeTableValues, 0 };
static const HashTable& getJSXMLHttpRequestUploadPrototypeTable(VM& vm)
{
    return getHashTableForGlobalData(vm, JSXMLHttpRequestUploadPrototypeTable);
}

const ClassInfo JSXMLHttpRequestUploadPrototype::s_info = { "XMLHttpRequestUploadPrototype", &Base::s_info, 0, getJSXMLHttpRequestUploadPrototypeTable, CREATE_METHOD_TABLE(JSXMLHttpRequestUploadPrototype) };

JSObject* JSXMLHttpRequestUploadPrototype::self(VM& vm, JSGlobalObject* globalObject)
{
    return getDOMPrototype<JSXMLHttpRequestUpload>(vm, globalObject);
}

bool JSXMLHttpRequestUploadPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    JSXMLHttpRequestUploadPrototype* thisObject = jsCast<JSXMLHttpRequestUploadPrototype*>(object);
    return getStaticFunctionSlot<JSObject>(exec, getJSXMLHttpRequestUploadPrototypeTable(exec->vm()), thisObject, propertyName, slot);
}

static const HashTable& getJSXMLHttpRequestUploadTable(VM& vm)
{
    return getHashTableForGlobalData(vm, JSXMLHttpRequestUploadTable);
}

const ClassInfo JSXMLHttpRequestUpload::s_info = { "XMLHttpRequestUpload", &Base::s_info, 0, getJSXMLHttpRequestUploadTable , CREATE_METHOD_TABLE(JSXMLHttpRequestUpload) };

JSXMLHttpRequestUpload::JSXMLHttpRequestUpload(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<XMLHttpRequestUpload> impl)
    : JSDOMWrapper(structure, globalObject)
    , m_impl(impl.leakRef())
{
}

void JSXMLHttpRequestUpload::finishCreation(VM& vm)
{
    Base::finishCreation(vm);
    ASSERT(inherits(info()));
}

JSObject* JSXMLHttpRequestUpload::createPrototype(VM& vm, JSGlobalObject* globalObject)
{
    return JSXMLHttpRequestUploadPrototype::create(vm, globalObject, JSXMLHttpRequestUploadPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
}

void JSXMLHttpRequestUpload::destroy(JSC::JSCell* cell)
{
    JSXMLHttpRequestUpload* thisObject = static_cast<JSXMLHttpRequestUpload*>(cell);
    thisObject->JSXMLHttpRequestUpload::~JSXMLHttpRequestUpload();
}

JSXMLHttpRequestUpload::~JSXMLHttpRequestUpload()
{
    releaseImplIfNotNull();
}

bool JSXMLHttpRequestUpload::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    JSXMLHttpRequestUpload* thisObject = jsCast<JSXMLHttpRequestUpload*>(object);
    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
    return getStaticValueSlot<JSXMLHttpRequestUpload, Base>(exec, getJSXMLHttpRequestUploadTable(exec->vm()), thisObject, propertyName, slot);
}

EncodedJSValue jsXMLHttpRequestUploadOnabort(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSXMLHttpRequestUpload* castedThis = jsDynamicCast<JSXMLHttpRequestUpload*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    XMLHttpRequestUpload& impl = castedThis->impl();
    if (EventListener* listener = impl.onabort()) {
        if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
            if (JSObject* jsFunction = jsListener->jsFunction(impl.scriptExecutionContext()))
                return JSValue::encode(jsFunction);
        }
    }
    return JSValue::encode(jsNull());
}


EncodedJSValue jsXMLHttpRequestUploadOnerror(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSXMLHttpRequestUpload* castedThis = jsDynamicCast<JSXMLHttpRequestUpload*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    XMLHttpRequestUpload& impl = castedThis->impl();
    if (EventListener* listener = impl.onerror()) {
        if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
            if (JSObject* jsFunction = jsListener->jsFunction(impl.scriptExecutionContext()))
                return JSValue::encode(jsFunction);
        }
    }
    return JSValue::encode(jsNull());
}


EncodedJSValue jsXMLHttpRequestUploadOnload(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSXMLHttpRequestUpload* castedThis = jsDynamicCast<JSXMLHttpRequestUpload*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    XMLHttpRequestUpload& impl = castedThis->impl();
    if (EventListener* listener = impl.onload()) {
        if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
            if (JSObject* jsFunction = jsListener->jsFunction(impl.scriptExecutionContext()))
                return JSValue::encode(jsFunction);
        }
    }
    return JSValue::encode(jsNull());
}


EncodedJSValue jsXMLHttpRequestUploadOnloadend(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSXMLHttpRequestUpload* castedThis = jsDynamicCast<JSXMLHttpRequestUpload*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    XMLHttpRequestUpload& impl = castedThis->impl();
    if (EventListener* listener = impl.onloadend()) {
        if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
            if (JSObject* jsFunction = jsListener->jsFunction(impl.scriptExecutionContext()))
                return JSValue::encode(jsFunction);
        }
    }
    return JSValue::encode(jsNull());
}


EncodedJSValue jsXMLHttpRequestUploadOnloadstart(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSXMLHttpRequestUpload* castedThis = jsDynamicCast<JSXMLHttpRequestUpload*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    XMLHttpRequestUpload& impl = castedThis->impl();
    if (EventListener* listener = impl.onloadstart()) {
        if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
            if (JSObject* jsFunction = jsListener->jsFunction(impl.scriptExecutionContext()))
                return JSValue::encode(jsFunction);
        }
    }
    return JSValue::encode(jsNull());
}


EncodedJSValue jsXMLHttpRequestUploadOnprogress(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSXMLHttpRequestUpload* castedThis = jsDynamicCast<JSXMLHttpRequestUpload*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    XMLHttpRequestUpload& impl = castedThis->impl();
    if (EventListener* listener = impl.onprogress()) {
        if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
            if (JSObject* jsFunction = jsListener->jsFunction(impl.scriptExecutionContext()))
                return JSValue::encode(jsFunction);
        }
    }
    return JSValue::encode(jsNull());
}


EncodedJSValue jsXMLHttpRequestUploadConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName)
{
    JSXMLHttpRequestUpload* domObject = jsDynamicCast<JSXMLHttpRequestUpload*>(JSValue::decode(thisValue));
    if (!domObject)
        return throwVMTypeError(exec);
    if (!domObject)
        return throwVMTypeError(exec);
    return JSValue::encode(JSXMLHttpRequestUpload::getConstructor(exec->vm(), domObject->globalObject()));
}

void setJSXMLHttpRequestUploadOnabort(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSXMLHttpRequestUpload* castedThis = jsDynamicCast<JSXMLHttpRequestUpload*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    UNUSED_PARAM(exec);
    XMLHttpRequestUpload& impl = castedThis->impl();
    impl.setOnabort(createJSAttributeEventListener(exec, value, castedThis));
}


void setJSXMLHttpRequestUploadOnerror(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSXMLHttpRequestUpload* castedThis = jsDynamicCast<JSXMLHttpRequestUpload*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    UNUSED_PARAM(exec);
    XMLHttpRequestUpload& impl = castedThis->impl();
    impl.setOnerror(createJSAttributeEventListener(exec, value, castedThis));
}


void setJSXMLHttpRequestUploadOnload(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSXMLHttpRequestUpload* castedThis = jsDynamicCast<JSXMLHttpRequestUpload*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    UNUSED_PARAM(exec);
    XMLHttpRequestUpload& impl = castedThis->impl();
    impl.setOnload(createJSAttributeEventListener(exec, value, castedThis));
}


void setJSXMLHttpRequestUploadOnloadend(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSXMLHttpRequestUpload* castedThis = jsDynamicCast<JSXMLHttpRequestUpload*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    UNUSED_PARAM(exec);
    XMLHttpRequestUpload& impl = castedThis->impl();
    impl.setOnloadend(createJSAttributeEventListener(exec, value, castedThis));
}


void setJSXMLHttpRequestUploadOnloadstart(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSXMLHttpRequestUpload* castedThis = jsDynamicCast<JSXMLHttpRequestUpload*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    UNUSED_PARAM(exec);
    XMLHttpRequestUpload& impl = castedThis->impl();
    impl.setOnloadstart(createJSAttributeEventListener(exec, value, castedThis));
}


void setJSXMLHttpRequestUploadOnprogress(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSXMLHttpRequestUpload* castedThis = jsDynamicCast<JSXMLHttpRequestUpload*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    UNUSED_PARAM(exec);
    XMLHttpRequestUpload& impl = castedThis->impl();
    impl.setOnprogress(createJSAttributeEventListener(exec, value, castedThis));
}


JSValue JSXMLHttpRequestUpload::getConstructor(VM& vm, JSGlobalObject* globalObject)
{
    return getDOMConstructor<JSXMLHttpRequestUploadConstructor>(vm, jsCast<JSDOMGlobalObject*>(globalObject));
}

EncodedJSValue JSC_HOST_CALL jsXMLHttpRequestUploadPrototypeFunctionAddEventListener(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSXMLHttpRequestUpload* castedThis = jsDynamicCast<JSXMLHttpRequestUpload*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSXMLHttpRequestUpload::info());
    XMLHttpRequestUpload& impl = castedThis->impl();
    JSValue listener = exec->argument(1);
    if (!listener.isObject())
        return JSValue::encode(jsUndefined());
    impl.addEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)), exec->argument(2).toBoolean(exec));
    return JSValue::encode(jsUndefined());
}

EncodedJSValue JSC_HOST_CALL jsXMLHttpRequestUploadPrototypeFunctionRemoveEventListener(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSXMLHttpRequestUpload* castedThis = jsDynamicCast<JSXMLHttpRequestUpload*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSXMLHttpRequestUpload::info());
    XMLHttpRequestUpload& impl = castedThis->impl();
    JSValue listener = exec->argument(1);
    if (!listener.isObject())
        return JSValue::encode(jsUndefined());
    impl.removeEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
    return JSValue::encode(jsUndefined());
}

EncodedJSValue JSC_HOST_CALL jsXMLHttpRequestUploadPrototypeFunctionDispatchEvent(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSXMLHttpRequestUpload* castedThis = jsDynamicCast<JSXMLHttpRequestUpload*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSXMLHttpRequestUpload::info());
    XMLHttpRequestUpload& impl = castedThis->impl();
    if (exec->argumentCount() < 1)
        return throwVMError(exec, createNotEnoughArgumentsError(exec));
    ExceptionCode ec = 0;
    Event* evt(toEvent(exec->argument(0)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    JSC::JSValue result = jsBoolean(impl.dispatchEvent(evt, ec));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}

void JSXMLHttpRequestUpload::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
    JSXMLHttpRequestUpload* thisObject = jsCast<JSXMLHttpRequestUpload*>(cell);
    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
    COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
    Base::visitChildren(thisObject, visitor);
    thisObject->impl().visitJSEventListeners(visitor);
}

static inline bool isObservable(JSXMLHttpRequestUpload* jsXMLHttpRequestUpload)
{
    if (jsXMLHttpRequestUpload->hasCustomProperties())
        return true;
    if (jsXMLHttpRequestUpload->impl().hasEventListeners())
        return true;
    return false;
}

bool JSXMLHttpRequestUploadOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSXMLHttpRequestUpload* jsXMLHttpRequestUpload = jsCast<JSXMLHttpRequestUpload*>(handle.get().asCell());
    if (jsXMLHttpRequestUpload->impl().isFiringEventListeners())
        return true;
    if (!isObservable(jsXMLHttpRequestUpload))
        return false;
    XMLHttpRequestUpload* root = &jsXMLHttpRequestUpload->impl();
    return visitor.containsOpaqueRoot(root);
}

void JSXMLHttpRequestUploadOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
    JSXMLHttpRequestUpload* jsXMLHttpRequestUpload = jsCast<JSXMLHttpRequestUpload*>(handle.get().asCell());
    DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
    uncacheWrapper(world, &jsXMLHttpRequestUpload->impl(), jsXMLHttpRequestUpload);
    jsXMLHttpRequestUpload->releaseImpl();
}

#if ENABLE(BINDING_INTEGRITY)
#if PLATFORM(WIN)
#pragma warning(disable: 4483)
extern "C" { extern void (*const __identifier("??_7XMLHttpRequestUpload@WebCore@@6B@")[])(); }
#else
extern "C" { extern void* _ZTVN7WebCore20XMLHttpRequestUploadE[]; }
#endif
#endif
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, XMLHttpRequestUpload* impl)
{
    if (!impl)
        return jsNull();
    if (JSValue result = getExistingWrapper<JSXMLHttpRequestUpload>(exec, impl))
        return result;

#if ENABLE(BINDING_INTEGRITY)
    void* actualVTablePointer = *(reinterpret_cast<void**>(impl));
#if PLATFORM(WIN)
    void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7XMLHttpRequestUpload@WebCore@@6B@"));
#else
    void* expectedVTablePointer = &_ZTVN7WebCore20XMLHttpRequestUploadE[2];
#if COMPILER(CLANG)
    // If this fails XMLHttpRequestUpload does not have a vtable, so you need to add the
    // ImplementationLacksVTable attribute to the interface definition
    COMPILE_ASSERT(__is_polymorphic(XMLHttpRequestUpload), XMLHttpRequestUpload_is_not_polymorphic);
#endif
#endif
    // If you hit this assertion you either have a use after free bug, or
    // XMLHttpRequestUpload has subclasses. If XMLHttpRequestUpload has subclasses that get passed
    // to toJS() we currently require XMLHttpRequestUpload you to opt out of binding hardening
    // by adding the SkipVTableValidation attribute to the interface IDL definition
    RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
#endif
    ReportMemoryCost<XMLHttpRequestUpload>::reportMemoryCost(exec, impl);
    return createNewWrapper<JSXMLHttpRequestUpload>(exec, globalObject, impl);
}

XMLHttpRequestUpload* toXMLHttpRequestUpload(JSC::JSValue value)
{
    return value.inherits(JSXMLHttpRequestUpload::info()) ? &jsCast<JSXMLHttpRequestUpload*>(value)->impl() : 0;
}

}
