blob: de99ae5bc83679f093af9f02f69c347d680893ff [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_AUDIO)
#include "JSAudioParam.h"
#include "ExceptionCode.h"
#include "JSDOMBinding.h"
#include "JSDOMConstructor.h"
#include "JSDOMConvert.h"
#include "URL.h"
#include <runtime/Error.h>
#include <runtime/FunctionPrototype.h>
#include <runtime/JSString.h>
#include <wtf/GetPtr.h>
using namespace JSC;
namespace WebCore {
// Functions
JSC::EncodedJSValue JSC_HOST_CALL jsAudioParamPrototypeFunctionSetValueAtTime(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsAudioParamPrototypeFunctionLinearRampToValueAtTime(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsAudioParamPrototypeFunctionExponentialRampToValueAtTime(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsAudioParamPrototypeFunctionSetTargetAtTime(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsAudioParamPrototypeFunctionSetValueCurveAtTime(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsAudioParamPrototypeFunctionCancelScheduledValues(JSC::ExecState*);
// Attributes
JSC::EncodedJSValue jsAudioParamValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
bool setJSAudioParamValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
JSC::EncodedJSValue jsAudioParamMinValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
JSC::EncodedJSValue jsAudioParamMaxValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
JSC::EncodedJSValue jsAudioParamDefaultValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
JSC::EncodedJSValue jsAudioParamName(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
JSC::EncodedJSValue jsAudioParamUnits(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
JSC::EncodedJSValue jsAudioParamConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
bool setJSAudioParamConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
class JSAudioParamPrototype : public JSC::JSNonFinalObject {
public:
typedef JSC::JSNonFinalObject Base;
static JSAudioParamPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
{
JSAudioParamPrototype* ptr = new (NotNull, JSC::allocateCell<JSAudioParamPrototype>(vm.heap)) JSAudioParamPrototype(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:
JSAudioParamPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
: JSC::JSNonFinalObject(vm, structure)
{
}
void finishCreation(JSC::VM&);
};
typedef JSDOMConstructorNotConstructable<JSAudioParam> JSAudioParamConstructor;
template<> JSValue JSAudioParamConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
{
UNUSED_PARAM(vm);
return globalObject.functionPrototype();
}
template<> void JSAudioParamConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
{
putDirect(vm, vm.propertyNames->prototype, JSAudioParam::prototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum);
putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("AudioParam"))), ReadOnly | DontEnum);
putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
}
template<> const ClassInfo JSAudioParamConstructor::s_info = { "AudioParam", &Base::s_info, 0, CREATE_METHOD_TABLE(JSAudioParamConstructor) };
/* Hash table for prototype */
static const HashTableValue JSAudioParamPrototypeTableValues[] =
{
{ "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioParamConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSAudioParamConstructor) } },
{ "value", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioParamValue), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSAudioParamValue) } },
{ "minValue", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioParamMinValue), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
{ "maxValue", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioParamMaxValue), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
{ "defaultValue", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioParamDefaultValue), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
{ "name", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioParamName), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
{ "units", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioParamUnits), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
{ "setValueAtTime", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsAudioParamPrototypeFunctionSetValueAtTime), (intptr_t) (2) } },
{ "linearRampToValueAtTime", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsAudioParamPrototypeFunctionLinearRampToValueAtTime), (intptr_t) (2) } },
{ "exponentialRampToValueAtTime", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsAudioParamPrototypeFunctionExponentialRampToValueAtTime), (intptr_t) (2) } },
{ "setTargetAtTime", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsAudioParamPrototypeFunctionSetTargetAtTime), (intptr_t) (3) } },
{ "setValueCurveAtTime", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsAudioParamPrototypeFunctionSetValueCurveAtTime), (intptr_t) (3) } },
{ "cancelScheduledValues", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsAudioParamPrototypeFunctionCancelScheduledValues), (intptr_t) (1) } },
};
const ClassInfo JSAudioParamPrototype::s_info = { "AudioParamPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSAudioParamPrototype) };
void JSAudioParamPrototype::finishCreation(VM& vm)
{
Base::finishCreation(vm);
reifyStaticProperties(vm, JSAudioParamPrototypeTableValues, *this);
}
const ClassInfo JSAudioParam::s_info = { "AudioParam", &Base::s_info, 0, CREATE_METHOD_TABLE(JSAudioParam) };
JSAudioParam::JSAudioParam(Structure* structure, JSDOMGlobalObject& globalObject, Ref<AudioParam>&& impl)
: JSDOMWrapper<AudioParam>(structure, globalObject, WTFMove(impl))
{
}
JSObject* JSAudioParam::createPrototype(VM& vm, JSGlobalObject* globalObject)
{
return JSAudioParamPrototype::create(vm, globalObject, JSAudioParamPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
}
JSObject* JSAudioParam::prototype(VM& vm, JSGlobalObject* globalObject)
{
return getDOMPrototype<JSAudioParam>(vm, globalObject);
}
void JSAudioParam::destroy(JSC::JSCell* cell)
{
JSAudioParam* thisObject = static_cast<JSAudioParam*>(cell);
thisObject->JSAudioParam::~JSAudioParam();
}
EncodedJSValue jsAudioParamValue(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<JSAudioParam*>(decodedThisValue);
if (UNLIKELY(!castedThis)) {
return throwGetterTypeError(*state, throwScope, "AudioParam", "value");
}
auto& impl = castedThis->wrapped();
JSValue result = jsNumber(impl.value());
return JSValue::encode(result);
}
EncodedJSValue jsAudioParamMinValue(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<JSAudioParam*>(decodedThisValue);
if (UNLIKELY(!castedThis)) {
return throwGetterTypeError(*state, throwScope, "AudioParam", "minValue");
}
auto& impl = castedThis->wrapped();
JSValue result = jsNumber(impl.minValue());
return JSValue::encode(result);
}
EncodedJSValue jsAudioParamMaxValue(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<JSAudioParam*>(decodedThisValue);
if (UNLIKELY(!castedThis)) {
return throwGetterTypeError(*state, throwScope, "AudioParam", "maxValue");
}
auto& impl = castedThis->wrapped();
JSValue result = jsNumber(impl.maxValue());
return JSValue::encode(result);
}
EncodedJSValue jsAudioParamDefaultValue(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<JSAudioParam*>(decodedThisValue);
if (UNLIKELY(!castedThis)) {
return throwGetterTypeError(*state, throwScope, "AudioParam", "defaultValue");
}
auto& impl = castedThis->wrapped();
JSValue result = jsNumber(impl.defaultValue());
return JSValue::encode(result);
}
EncodedJSValue jsAudioParamName(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<JSAudioParam*>(decodedThisValue);
if (UNLIKELY(!castedThis)) {
return throwGetterTypeError(*state, throwScope, "AudioParam", "name");
}
auto& impl = castedThis->wrapped();
JSValue result = jsStringWithCache(state, impl.name());
return JSValue::encode(result);
}
EncodedJSValue jsAudioParamUnits(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<JSAudioParam*>(decodedThisValue);
if (UNLIKELY(!castedThis)) {
return throwGetterTypeError(*state, throwScope, "AudioParam", "units");
}
auto& impl = castedThis->wrapped();
JSValue result = jsNumber(impl.units());
return JSValue::encode(result);
}
EncodedJSValue jsAudioParamConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
JSAudioParamPrototype* domObject = jsDynamicCast<JSAudioParamPrototype*>(JSValue::decode(thisValue));
if (UNLIKELY(!domObject))
return throwVMTypeError(state, throwScope);
return JSValue::encode(JSAudioParam::getConstructor(state->vm(), domObject->globalObject()));
}
bool setJSAudioParamConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
JSValue value = JSValue::decode(encodedValue);
JSAudioParamPrototype* domObject = jsDynamicCast<JSAudioParamPrototype*>(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);
}
bool setJSAudioParamValue(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue value = JSValue::decode(encodedValue);
UNUSED_PARAM(thisValue);
JSAudioParam* castedThis = jsDynamicCast<JSAudioParam*>(JSValue::decode(thisValue));
if (UNLIKELY(!castedThis)) {
return throwSetterTypeError(*state, throwScope, "AudioParam", "value");
}
auto& impl = castedThis->wrapped();
auto nativeValue = convert<float>(*state, value, ShouldAllowNonFinite::Yes);
RETURN_IF_EXCEPTION(throwScope, false);
impl.setValue(WTFMove(nativeValue));
return true;
}
JSValue JSAudioParam::getConstructor(VM& vm, const JSGlobalObject* globalObject)
{
return getDOMConstructor<JSAudioParamConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
}
EncodedJSValue JSC_HOST_CALL jsAudioParamPrototypeFunctionSetValueAtTime(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSAudioParam*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "AudioParam", "setValueAtTime");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSAudioParam::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 2))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto value = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto time = convert<float>(*state, state->uncheckedArgument(1), ShouldAllowNonFinite::Yes);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.setValueAtTime(WTFMove(value), WTFMove(time));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsAudioParamPrototypeFunctionLinearRampToValueAtTime(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSAudioParam*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "AudioParam", "linearRampToValueAtTime");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSAudioParam::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 2))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto value = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto time = convert<float>(*state, state->uncheckedArgument(1), ShouldAllowNonFinite::Yes);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.linearRampToValueAtTime(WTFMove(value), WTFMove(time));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsAudioParamPrototypeFunctionExponentialRampToValueAtTime(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSAudioParam*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "AudioParam", "exponentialRampToValueAtTime");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSAudioParam::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 2))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto value = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto time = convert<float>(*state, state->uncheckedArgument(1), ShouldAllowNonFinite::Yes);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.exponentialRampToValueAtTime(WTFMove(value), WTFMove(time));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsAudioParamPrototypeFunctionSetTargetAtTime(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSAudioParam*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "AudioParam", "setTargetAtTime");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSAudioParam::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 3))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto target = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto time = convert<float>(*state, state->uncheckedArgument(1), ShouldAllowNonFinite::Yes);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto timeConstant = convert<float>(*state, state->uncheckedArgument(2), ShouldAllowNonFinite::Yes);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.setTargetAtTime(WTFMove(target), WTFMove(time), WTFMove(timeConstant));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsAudioParamPrototypeFunctionSetValueCurveAtTime(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSAudioParam*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "AudioParam", "setValueCurveAtTime");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSAudioParam::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 3))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto values = toFloat32Array(state->uncheckedArgument(0));
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto time = convert<float>(*state, state->uncheckedArgument(1), ShouldAllowNonFinite::Yes);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto duration = convert<float>(*state, state->uncheckedArgument(2), ShouldAllowNonFinite::Yes);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.setValueCurveAtTime(WTFMove(values), WTFMove(time), WTFMove(duration));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsAudioParamPrototypeFunctionCancelScheduledValues(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSAudioParam*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "AudioParam", "cancelScheduledValues");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSAudioParam::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 1))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto startTime = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.cancelScheduledValues(WTFMove(startTime));
return JSValue::encode(jsUndefined());
}
bool JSAudioParamOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
UNUSED_PARAM(handle);
UNUSED_PARAM(visitor);
return false;
}
void JSAudioParamOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
auto* jsAudioParam = jsCast<JSAudioParam*>(handle.slot()->asCell());
auto& world = *static_cast<DOMWrapperWorld*>(context);
uncacheWrapper(world, &jsAudioParam->wrapped(), jsAudioParam);
}
#if ENABLE(BINDING_INTEGRITY)
#if PLATFORM(WIN)
#pragma warning(disable: 4483)
extern "C" { extern void (*const __identifier("??_7AudioParam@WebCore@@6B@")[])(); }
#else
extern "C" { extern void* _ZTVN7WebCore10AudioParamE[]; }
#endif
#endif
JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<AudioParam>&& impl)
{
#if ENABLE(BINDING_INTEGRITY)
void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
#if PLATFORM(WIN)
void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7AudioParam@WebCore@@6B@"));
#else
void* expectedVTablePointer = &_ZTVN7WebCore10AudioParamE[2];
#if COMPILER(CLANG)
// If this fails AudioParam does not have a vtable, so you need to add the
// ImplementationLacksVTable attribute to the interface definition
static_assert(__is_polymorphic(AudioParam), "AudioParam is not polymorphic");
#endif
#endif
// If you hit this assertion you either have a use after free bug, or
// AudioParam has subclasses. If AudioParam has subclasses that get passed
// to toJS() we currently require AudioParam you to opt out of binding hardening
// by adding the SkipVTableValidation attribute to the interface IDL definition
RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
#endif
return createWrapper<AudioParam>(globalObject, WTFMove(impl));
}
JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, AudioParam& impl)
{
return wrap(state, globalObject, impl);
}
AudioParam* JSAudioParam::toWrapped(JSC::JSValue value)
{
if (auto* wrapper = jsDynamicCast<JSAudioParam*>(value))
return &wrapper->wrapped();
return nullptr;
}
}
#endif // ENABLE(WEB_AUDIO)