blob: 422bddfe3673cc6b6ebcf8c4ac4ae63ea526ed9b [file] [log] [blame]
/*
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(WEB_RTC)
#include "JSRTCIceCandidateEvent.h"
#include "JSDOMBinding.h"
#include "JSRTCIceCandidate.h"
#include <wtf/GetPtr.h>
using namespace JSC;
namespace WebCore {
// Attributes
JSC::EncodedJSValue jsRTCIceCandidateEventCandidate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
bool setJSRTCIceCandidateEventConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
class JSRTCIceCandidateEventPrototype : public JSC::JSNonFinalObject {
public:
typedef JSC::JSNonFinalObject Base;
static JSRTCIceCandidateEventPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
{
JSRTCIceCandidateEventPrototype* ptr = new (NotNull, JSC::allocateCell<JSRTCIceCandidateEventPrototype>(vm.heap)) JSRTCIceCandidateEventPrototype(vm, globalObject, structure);
ptr->finishCreation(vm);
return ptr;
}
DECLARE_INFO;
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
{
return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
}
private:
JSRTCIceCandidateEventPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
: JSC::JSNonFinalObject(vm, structure)
{
}
void finishCreation(JSC::VM&);
};
/* Hash table for prototype */
static const HashTableValue JSRTCIceCandidateEventPrototypeTableValues[] =
{
{ "candidate", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRTCIceCandidateEventCandidate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
};
const ClassInfo JSRTCIceCandidateEventPrototype::s_info = { "RTCIceCandidateEventPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSRTCIceCandidateEventPrototype) };
void JSRTCIceCandidateEventPrototype::finishCreation(VM& vm)
{
Base::finishCreation(vm);
reifyStaticProperties(vm, JSRTCIceCandidateEventPrototypeTableValues, *this);
}
const ClassInfo JSRTCIceCandidateEvent::s_info = { "RTCIceCandidateEvent", &Base::s_info, 0, CREATE_METHOD_TABLE(JSRTCIceCandidateEvent) };
JSRTCIceCandidateEvent::JSRTCIceCandidateEvent(Structure* structure, JSDOMGlobalObject& globalObject, Ref<RTCIceCandidateEvent>&& impl)
: JSEvent(structure, globalObject, WTFMove(impl))
{
}
JSObject* JSRTCIceCandidateEvent::createPrototype(VM& vm, JSGlobalObject* globalObject)
{
return JSRTCIceCandidateEventPrototype::create(vm, globalObject, JSRTCIceCandidateEventPrototype::createStructure(vm, globalObject, JSEvent::prototype(vm, globalObject)));
}
JSObject* JSRTCIceCandidateEvent::prototype(VM& vm, JSGlobalObject* globalObject)
{
return getDOMPrototype<JSRTCIceCandidateEvent>(vm, globalObject);
}
EncodedJSValue jsRTCIceCandidateEventCandidate(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
UNUSED_PARAM(thisValue);
JSValue decodedThisValue = JSValue::decode(thisValue);
auto* castedThis = jsDynamicCast<JSRTCIceCandidateEvent*>(decodedThisValue);
if (UNLIKELY(!castedThis)) {
return throwGetterTypeError(*state, throwScope, "RTCIceCandidateEvent", "candidate");
}
auto& impl = castedThis->wrapped();
JSValue result = toJS(state, castedThis->globalObject(), impl.candidate());
return JSValue::encode(result);
}
bool setJSRTCIceCandidateEventConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
JSValue value = JSValue::decode(encodedValue);
JSRTCIceCandidateEventPrototype* domObject = jsDynamicCast<JSRTCIceCandidateEventPrototype*>(JSValue::decode(thisValue));
if (UNLIKELY(!domObject)) {
throwVMTypeError(state, throwScope);
return false;
}
// Shadowing a built-in constructor
return domObject->putDirect(state->vm(), state->propertyNames().constructor, value);
}
}
#endif // ENABLE(WEB_RTC)