/*
    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"

#if ENABLE(MEDIA_STREAM)

#include "JSRTCIceCandidateEvent.h"

#include "JSRTCIceCandidate.h"
#include "RTCIceCandidate.h"
#include "RTCIceCandidateEvent.h"
#include <wtf/GetPtr.h>

using namespace JSC;

namespace WebCore {

/* Hash table */

static const HashTableValue JSRTCIceCandidateEventTableValues[] =
{
    { "candidate", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRTCIceCandidateEventCandidate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSRTCIceCandidateEventTable = { 2, 1, true, JSRTCIceCandidateEventTableValues, 0 };
/* Hash table for prototype */

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

static const HashTable JSRTCIceCandidateEventPrototypeTable = { 1, 0, false, JSRTCIceCandidateEventPrototypeTableValues, 0 };
const ClassInfo JSRTCIceCandidateEventPrototype::s_info = { "RTCIceCandidateEventPrototype", &Base::s_info, &JSRTCIceCandidateEventPrototypeTable, 0, CREATE_METHOD_TABLE(JSRTCIceCandidateEventPrototype) };

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

const ClassInfo JSRTCIceCandidateEvent::s_info = { "RTCIceCandidateEvent", &Base::s_info, &JSRTCIceCandidateEventTable, 0 , CREATE_METHOD_TABLE(JSRTCIceCandidateEvent) };

JSRTCIceCandidateEvent::JSRTCIceCandidateEvent(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<RTCIceCandidateEvent> impl)
    : JSEvent(structure, globalObject, impl)
{
}

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

JSObject* JSRTCIceCandidateEvent::createPrototype(VM& vm, JSGlobalObject* globalObject)
{
    return JSRTCIceCandidateEventPrototype::create(vm, globalObject, JSRTCIceCandidateEventPrototype::createStructure(vm, globalObject, JSEventPrototype::self(vm, globalObject)));
}

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

EncodedJSValue jsRTCIceCandidateEventCandidate(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSRTCIceCandidateEvent* castedThis = jsDynamicCast<JSRTCIceCandidateEvent*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    RTCIceCandidateEvent& impl = castedThis->impl();
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.candidate()));
    return JSValue::encode(result);
}



}

#endif // ENABLE(MEDIA_STREAM)
