| /* |
| 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 "JSTestCallTracer.h" |
| |
| #include "ActiveDOMObject.h" |
| #include "CallTracer.h" |
| #include "JSDOMAttribute.h" |
| #include "JSDOMBinding.h" |
| #include "JSDOMConstructorNotConstructable.h" |
| #include "JSDOMConvertBoolean.h" |
| #include "JSDOMConvertInterface.h" |
| #include "JSDOMConvertNullable.h" |
| #include "JSDOMConvertNumbers.h" |
| #include "JSDOMConvertStrings.h" |
| #include "JSDOMConvertUnion.h" |
| #include "JSDOMExceptionHandling.h" |
| #include "JSDOMGlobalObject.h" |
| #include "JSDOMOperation.h" |
| #include "JSDOMWrapperCache.h" |
| #include "JSNode.h" |
| #include "ScriptExecutionContext.h" |
| #include <JavaScriptCore/FunctionPrototype.h> |
| #include <JavaScriptCore/HeapAnalyzer.h> |
| #include <JavaScriptCore/JSCInlines.h> |
| #include <wtf/GetPtr.h> |
| #include <wtf/PointerPreparations.h> |
| #include <wtf/URL.h> |
| #include <wtf/Variant.h> |
| |
| |
| namespace WebCore { |
| using namespace JSC; |
| |
| // Functions |
| |
| JSC::EncodedJSValue JSC_HOST_CALL jsTestCallTracerPrototypeFunctionTestOperationInterface(JSC::JSGlobalObject*, JSC::CallFrame*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsTestCallTracerPrototypeFunctionTestOperationSpecified(JSC::JSGlobalObject*, JSC::CallFrame*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsTestCallTracerPrototypeFunctionTestOperationWithArguments(JSC::JSGlobalObject*, JSC::CallFrame*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgument(JSC::JSGlobalObject*, JSC::CallFrame*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgument(JSC::JSGlobalObject*, JSC::CallFrame*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsTestCallTracerPrototypeFunctionTestOperationWithNullableVariantArgument(JSC::JSGlobalObject*, JSC::CallFrame*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsTestCallTracerPrototypeFunctionTestOperationWithOptionalVariantArgument(JSC::JSGlobalObject*, JSC::CallFrame*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsTestCallTracerPrototypeFunctionTestOperationWithDefaultVariantArgument(JSC::JSGlobalObject*, JSC::CallFrame*); |
| |
| // Attributes |
| |
| JSC::EncodedJSValue jsTestCallTracerConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestCallTracerConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsTestCallTracerTestAttributeInterface(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestCallTracerTestAttributeInterface(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsTestCallTracerTestAttributeSpecified(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestCallTracerTestAttributeSpecified(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsTestCallTracerTestAttributeWithVariant(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestCallTracerTestAttributeWithVariant(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsTestCallTracerTestReadonlyAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| |
| class JSTestCallTracerPrototype : public JSC::JSNonFinalObject { |
| public: |
| using Base = JSC::JSNonFinalObject; |
| static JSTestCallTracerPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
| { |
| JSTestCallTracerPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestCallTracerPrototype>(vm.heap)) JSTestCallTracerPrototype(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: |
| JSTestCallTracerPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
| : JSC::JSNonFinalObject(vm, structure) |
| { |
| } |
| |
| void finishCreation(JSC::VM&); |
| }; |
| |
| using JSTestCallTracerConstructor = JSDOMConstructorNotConstructable<JSTestCallTracer>; |
| |
| /* Hash table for constructor */ |
| |
| static const HashTableValue JSTestCallTracerConstructorTableValues[] = |
| { |
| { "testConstValue", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(false) } }, |
| }; |
| |
| static_assert(TestCallTracer::testConstValue == false, "testConstValue in TestCallTracer does not match value from IDL"); |
| |
| template<> JSValue JSTestCallTracerConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
| { |
| UNUSED_PARAM(vm); |
| return globalObject.functionPrototype(); |
| } |
| |
| template<> void JSTestCallTracerConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
| { |
| putDirect(vm, vm.propertyNames->prototype, JSTestCallTracer::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| putDirect(vm, vm.propertyNames->name, jsNontrivialString(vm, String("TestCallTracer"_s)), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| reifyStaticProperties(vm, JSTestCallTracer::info(), JSTestCallTracerConstructorTableValues, *this); |
| } |
| |
| template<> const ClassInfo JSTestCallTracerConstructor::s_info = { "TestCallTracer", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestCallTracerConstructor) }; |
| |
| /* Hash table for prototype */ |
| |
| static const HashTableValue JSTestCallTracerPrototypeTableValues[] = |
| { |
| { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestCallTracerConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestCallTracerConstructor) } }, |
| { "testAttributeInterface", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestCallTracerTestAttributeInterface), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestCallTracerTestAttributeInterface) } }, |
| { "testAttributeSpecified", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestCallTracerTestAttributeSpecified), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestCallTracerTestAttributeSpecified) } }, |
| { "testAttributeWithVariant", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestCallTracerTestAttributeWithVariant), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestCallTracerTestAttributeWithVariant) } }, |
| { "testReadonlyAttribute", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestCallTracerTestReadonlyAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| { "testOperationInterface", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestCallTracerPrototypeFunctionTestOperationInterface), (intptr_t) (0) } }, |
| { "testOperationSpecified", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestCallTracerPrototypeFunctionTestOperationSpecified), (intptr_t) (0) } }, |
| { "testOperationWithArguments", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestCallTracerPrototypeFunctionTestOperationWithArguments), (intptr_t) (3) } }, |
| { "testOperationWithNullableArgument", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgument), (intptr_t) (1) } }, |
| { "testOperationWithVariantArgument", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgument), (intptr_t) (1) } }, |
| { "testOperationWithNullableVariantArgument", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestCallTracerPrototypeFunctionTestOperationWithNullableVariantArgument), (intptr_t) (1) } }, |
| { "testOperationWithOptionalVariantArgument", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestCallTracerPrototypeFunctionTestOperationWithOptionalVariantArgument), (intptr_t) (0) } }, |
| { "testOperationWithDefaultVariantArgument", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestCallTracerPrototypeFunctionTestOperationWithDefaultVariantArgument), (intptr_t) (0) } }, |
| { "testConstValue", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(false) } }, |
| }; |
| |
| const ClassInfo JSTestCallTracerPrototype::s_info = { "TestCallTracerPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestCallTracerPrototype) }; |
| |
| void JSTestCallTracerPrototype::finishCreation(VM& vm) |
| { |
| Base::finishCreation(vm); |
| reifyStaticProperties(vm, JSTestCallTracer::info(), JSTestCallTracerPrototypeTableValues, *this); |
| } |
| |
| const ClassInfo JSTestCallTracer::s_info = { "TestCallTracer", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestCallTracer) }; |
| |
| JSTestCallTracer::JSTestCallTracer(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestCallTracer>&& impl) |
| : JSDOMWrapper<TestCallTracer>(structure, globalObject, WTFMove(impl)) |
| { |
| } |
| |
| void JSTestCallTracer::finishCreation(VM& vm) |
| { |
| Base::finishCreation(vm); |
| ASSERT(inherits(vm, info())); |
| |
| static_assert(!std::is_base_of<ActiveDOMObject, TestCallTracer>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject."); |
| |
| } |
| |
| JSObject* JSTestCallTracer::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
| { |
| return JSTestCallTracerPrototype::create(vm, &globalObject, JSTestCallTracerPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); |
| } |
| |
| JSObject* JSTestCallTracer::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
| { |
| return getDOMPrototype<JSTestCallTracer>(vm, globalObject); |
| } |
| |
| JSValue JSTestCallTracer::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
| { |
| return getDOMConstructor<JSTestCallTracerConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
| } |
| |
| void JSTestCallTracer::destroy(JSC::JSCell* cell) |
| { |
| JSTestCallTracer* thisObject = static_cast<JSTestCallTracer*>(cell); |
| thisObject->JSTestCallTracer::~JSTestCallTracer(); |
| } |
| |
| template<> inline JSTestCallTracer* IDLAttribute<JSTestCallTracer>::cast(JSGlobalObject& lexicalGlobalObject, EncodedJSValue thisValue) |
| { |
| return jsDynamicCast<JSTestCallTracer*>(JSC::getVM(&lexicalGlobalObject), JSValue::decode(thisValue)); |
| } |
| |
| template<> inline JSTestCallTracer* IDLOperation<JSTestCallTracer>::cast(JSGlobalObject& lexicalGlobalObject, CallFrame& callFrame) |
| { |
| return jsDynamicCast<JSTestCallTracer*>(JSC::getVM(&lexicalGlobalObject), callFrame.thisValue()); |
| } |
| |
| EncodedJSValue jsTestCallTracerConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = JSC::getVM(lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto* prototype = jsDynamicCast<JSTestCallTracerPrototype*>(vm, JSValue::decode(thisValue)); |
| if (UNLIKELY(!prototype)) |
| return throwVMTypeError(lexicalGlobalObject, throwScope); |
| return JSValue::encode(JSTestCallTracer::getConstructor(JSC::getVM(lexicalGlobalObject), prototype->globalObject())); |
| } |
| |
| bool setJSTestCallTracerConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = JSC::getVM(lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto* prototype = jsDynamicCast<JSTestCallTracerPrototype*>(vm, JSValue::decode(thisValue)); |
| if (UNLIKELY(!prototype)) { |
| throwVMTypeError(lexicalGlobalObject, throwScope); |
| return false; |
| } |
| // Shadowing a built-in constructor |
| return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
| } |
| |
| static inline JSValue jsTestCallTracerTestAttributeInterfaceGetter(JSGlobalObject& lexicalGlobalObject, JSTestCallTracer& thisObject, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(lexicalGlobalObject); |
| auto& impl = thisObject.wrapped(); |
| if (UNLIKELY(impl.callTracingActive())) |
| CallTracer::testCallTracerInterface(impl, "testAttributeInterface"_s); |
| JSValue result = toJS<IDLBoolean>(lexicalGlobalObject, throwScope, impl.testAttributeInterface()); |
| return result; |
| } |
| |
| EncodedJSValue jsTestCallTracerTestAttributeInterface(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| return IDLAttribute<JSTestCallTracer>::get<jsTestCallTracerTestAttributeInterfaceGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "testAttributeInterface"); |
| } |
| |
| static inline bool setJSTestCallTracerTestAttributeInterfaceSetter(JSGlobalObject& lexicalGlobalObject, JSTestCallTracer& thisObject, JSValue value, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(throwScope); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLBoolean>(lexicalGlobalObject, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| if (UNLIKELY(impl.callTracingActive())) |
| CallTracer::testCallTracerInterface(impl, "testAttributeInterface"_s, { nativeValue }); |
| AttributeSetter::call(lexicalGlobalObject, throwScope, [&] { |
| return impl.setTestAttributeInterface(WTFMove(nativeValue)); |
| }); |
| return true; |
| } |
| |
| bool setJSTestCallTracerTestAttributeInterface(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| return IDLAttribute<JSTestCallTracer>::set<setJSTestCallTracerTestAttributeInterfaceSetter>(*lexicalGlobalObject, thisValue, encodedValue, "testAttributeInterface"); |
| } |
| |
| static inline JSValue jsTestCallTracerTestAttributeSpecifiedGetter(JSGlobalObject& lexicalGlobalObject, JSTestCallTracer& thisObject, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(lexicalGlobalObject); |
| auto& impl = thisObject.wrapped(); |
| if (UNLIKELY(impl.callTracingActive())) |
| CallTracer::testCallTracerAttribute(impl, "testAttributeSpecified"_s); |
| JSValue result = toJS<IDLBoolean>(lexicalGlobalObject, throwScope, impl.testAttributeSpecified()); |
| return result; |
| } |
| |
| EncodedJSValue jsTestCallTracerTestAttributeSpecified(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| return IDLAttribute<JSTestCallTracer>::get<jsTestCallTracerTestAttributeSpecifiedGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "testAttributeSpecified"); |
| } |
| |
| static inline bool setJSTestCallTracerTestAttributeSpecifiedSetter(JSGlobalObject& lexicalGlobalObject, JSTestCallTracer& thisObject, JSValue value, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(throwScope); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLBoolean>(lexicalGlobalObject, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| if (UNLIKELY(impl.callTracingActive())) |
| CallTracer::testCallTracerAttribute(impl, "testAttributeSpecified"_s, { nativeValue }); |
| AttributeSetter::call(lexicalGlobalObject, throwScope, [&] { |
| return impl.setTestAttributeSpecified(WTFMove(nativeValue)); |
| }); |
| return true; |
| } |
| |
| bool setJSTestCallTracerTestAttributeSpecified(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| return IDLAttribute<JSTestCallTracer>::set<setJSTestCallTracerTestAttributeSpecifiedSetter>(*lexicalGlobalObject, thisValue, encodedValue, "testAttributeSpecified"); |
| } |
| |
| static inline JSValue jsTestCallTracerTestAttributeWithVariantGetter(JSGlobalObject& lexicalGlobalObject, JSTestCallTracer& thisObject, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(lexicalGlobalObject); |
| auto& impl = thisObject.wrapped(); |
| if (UNLIKELY(impl.callTracingActive())) |
| CallTracer::testCallTracerInterface(impl, "testAttributeWithVariant"_s); |
| JSValue result = toJS<IDLUnion<IDLBoolean, IDLFloat, IDLDOMString>>(lexicalGlobalObject, *thisObject.globalObject(), throwScope, impl.testAttributeWithVariant()); |
| return result; |
| } |
| |
| EncodedJSValue jsTestCallTracerTestAttributeWithVariant(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| return IDLAttribute<JSTestCallTracer>::get<jsTestCallTracerTestAttributeWithVariantGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "testAttributeWithVariant"); |
| } |
| |
| static inline bool setJSTestCallTracerTestAttributeWithVariantSetter(JSGlobalObject& lexicalGlobalObject, JSTestCallTracer& thisObject, JSValue value, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(throwScope); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLUnion<IDLBoolean, IDLFloat, IDLDOMString>>(lexicalGlobalObject, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| if (UNLIKELY(impl.callTracingActive())) |
| CallTracer::testCallTracerInterface(impl, "testAttributeWithVariant"_s, { nativeValue }); |
| AttributeSetter::call(lexicalGlobalObject, throwScope, [&] { |
| return impl.setTestAttributeWithVariant(WTFMove(nativeValue)); |
| }); |
| return true; |
| } |
| |
| bool setJSTestCallTracerTestAttributeWithVariant(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| return IDLAttribute<JSTestCallTracer>::set<setJSTestCallTracerTestAttributeWithVariantSetter>(*lexicalGlobalObject, thisValue, encodedValue, "testAttributeWithVariant"); |
| } |
| |
| static inline JSValue jsTestCallTracerTestReadonlyAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestCallTracer& thisObject, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(lexicalGlobalObject); |
| auto& impl = thisObject.wrapped(); |
| JSValue result = toJS<IDLBoolean>(lexicalGlobalObject, throwScope, impl.testReadonlyAttribute()); |
| return result; |
| } |
| |
| EncodedJSValue jsTestCallTracerTestReadonlyAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| return IDLAttribute<JSTestCallTracer>::get<jsTestCallTracerTestReadonlyAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "testReadonlyAttribute"); |
| } |
| |
| static inline JSC::EncodedJSValue jsTestCallTracerPrototypeFunctionTestOperationInterfaceBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestCallTracer>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(callFrame); |
| UNUSED_PARAM(throwScope); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(impl.callTracingActive())) |
| CallTracer::testCallTracerInterface(impl, "testOperationInterface"_s); |
| impl.testOperationInterface(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestCallTracerPrototypeFunctionTestOperationInterface(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame) |
| { |
| return IDLOperation<JSTestCallTracer>::call<jsTestCallTracerPrototypeFunctionTestOperationInterfaceBody>(*lexicalGlobalObject, *callFrame, "testOperationInterface"); |
| } |
| |
| static inline JSC::EncodedJSValue jsTestCallTracerPrototypeFunctionTestOperationSpecifiedBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestCallTracer>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(callFrame); |
| UNUSED_PARAM(throwScope); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(impl.callTracingActive())) |
| CallTracer::testCallTracerOperation(impl, "testOperationSpecified"_s); |
| impl.testOperationSpecified(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestCallTracerPrototypeFunctionTestOperationSpecified(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame) |
| { |
| return IDLOperation<JSTestCallTracer>::call<jsTestCallTracerPrototypeFunctionTestOperationSpecifiedBody>(*lexicalGlobalObject, *callFrame, "testOperationSpecified"); |
| } |
| |
| static inline JSC::EncodedJSValue jsTestCallTracerPrototypeFunctionTestOperationWithArgumentsBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestCallTracer>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(callFrame); |
| UNUSED_PARAM(throwScope); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(callFrame->argumentCount() < 3)) |
| return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); |
| auto a = convert<IDLBoolean>(*lexicalGlobalObject, callFrame->uncheckedArgument(0)); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto b = convert<IDLFloat>(*lexicalGlobalObject, callFrame->uncheckedArgument(1)); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto c = convert<IDLDOMString>(*lexicalGlobalObject, callFrame->uncheckedArgument(2)); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| if (UNLIKELY(impl.callTracingActive())) |
| CallTracer::testCallTracerInterface(impl, "testOperationWithArguments"_s, { a, b, c }); |
| impl.testOperationWithArguments(WTFMove(a), WTFMove(b), WTFMove(c)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestCallTracerPrototypeFunctionTestOperationWithArguments(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame) |
| { |
| return IDLOperation<JSTestCallTracer>::call<jsTestCallTracerPrototypeFunctionTestOperationWithArgumentsBody>(*lexicalGlobalObject, *callFrame, "testOperationWithArguments"); |
| } |
| |
| static inline JSC::EncodedJSValue jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgumentBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestCallTracer>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(callFrame); |
| UNUSED_PARAM(throwScope); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(callFrame->argumentCount() < 1)) |
| return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); |
| auto nodeNullableArg = convert<IDLNullable<IDLInterface<Node>>>(*lexicalGlobalObject, callFrame->uncheckedArgument(0), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 0, "nodeNullableArg", "TestCallTracer", "testOperationWithNullableArgument", "Node"); }); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| if (UNLIKELY(impl.callTracingActive())) |
| CallTracer::testCallTracerInterface(impl, "testOperationWithNullableArgument"_s, { nodeNullableArg }); |
| impl.testOperationWithNullableArgument(WTFMove(nodeNullableArg)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgument(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame) |
| { |
| return IDLOperation<JSTestCallTracer>::call<jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgumentBody>(*lexicalGlobalObject, *callFrame, "testOperationWithNullableArgument"); |
| } |
| |
| static inline JSC::EncodedJSValue jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgumentBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestCallTracer>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(callFrame); |
| UNUSED_PARAM(throwScope); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(callFrame->argumentCount() < 1)) |
| return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); |
| auto variantArg = convert<IDLUnion<IDLBoolean, IDLFloat, IDLDOMString>>(*lexicalGlobalObject, callFrame->uncheckedArgument(0)); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| if (UNLIKELY(impl.callTracingActive())) |
| CallTracer::testCallTracerInterface(impl, "testOperationWithVariantArgument"_s, { variantArg }); |
| impl.testOperationWithVariantArgument(WTFMove(variantArg)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgument(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame) |
| { |
| return IDLOperation<JSTestCallTracer>::call<jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgumentBody>(*lexicalGlobalObject, *callFrame, "testOperationWithVariantArgument"); |
| } |
| |
| static inline JSC::EncodedJSValue jsTestCallTracerPrototypeFunctionTestOperationWithNullableVariantArgumentBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestCallTracer>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(callFrame); |
| UNUSED_PARAM(throwScope); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(callFrame->argumentCount() < 1)) |
| return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); |
| auto variantNullableArg = convert<IDLNullable<IDLUnion<IDLBoolean, IDLFloat, IDLDOMString>>>(*lexicalGlobalObject, callFrame->uncheckedArgument(0)); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| if (UNLIKELY(impl.callTracingActive())) |
| CallTracer::testCallTracerInterface(impl, "testOperationWithNullableVariantArgument"_s, { variantNullableArg }); |
| impl.testOperationWithNullableVariantArgument(WTFMove(variantNullableArg)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestCallTracerPrototypeFunctionTestOperationWithNullableVariantArgument(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame) |
| { |
| return IDLOperation<JSTestCallTracer>::call<jsTestCallTracerPrototypeFunctionTestOperationWithNullableVariantArgumentBody>(*lexicalGlobalObject, *callFrame, "testOperationWithNullableVariantArgument"); |
| } |
| |
| static inline JSC::EncodedJSValue jsTestCallTracerPrototypeFunctionTestOperationWithOptionalVariantArgumentBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestCallTracer>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(callFrame); |
| UNUSED_PARAM(throwScope); |
| auto& impl = castedThis->wrapped(); |
| auto variantOptionalArg = callFrame->argument(0).isUndefined() ? Optional<Converter<IDLUnion<IDLBoolean, IDLFloat, IDLDOMString>>::ReturnType>() : Optional<Converter<IDLUnion<IDLBoolean, IDLFloat, IDLDOMString>>::ReturnType>(convert<IDLUnion<IDLBoolean, IDLFloat, IDLDOMString>>(*lexicalGlobalObject, callFrame->uncheckedArgument(0))); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| if (UNLIKELY(impl.callTracingActive())) |
| CallTracer::testCallTracerInterface(impl, "testOperationWithOptionalVariantArgument"_s, { variantOptionalArg }); |
| impl.testOperationWithOptionalVariantArgument(WTFMove(variantOptionalArg)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestCallTracerPrototypeFunctionTestOperationWithOptionalVariantArgument(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame) |
| { |
| return IDLOperation<JSTestCallTracer>::call<jsTestCallTracerPrototypeFunctionTestOperationWithOptionalVariantArgumentBody>(*lexicalGlobalObject, *callFrame, "testOperationWithOptionalVariantArgument"); |
| } |
| |
| static inline JSC::EncodedJSValue jsTestCallTracerPrototypeFunctionTestOperationWithDefaultVariantArgumentBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestCallTracer>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(callFrame); |
| UNUSED_PARAM(throwScope); |
| auto& impl = castedThis->wrapped(); |
| auto variantDefaultArg = callFrame->argument(0).isUndefined() ? "" : convert<IDLUnion<IDLBoolean, IDLFloat, IDLDOMString>>(*lexicalGlobalObject, callFrame->uncheckedArgument(0)); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| if (UNLIKELY(impl.callTracingActive())) |
| CallTracer::testCallTracerInterface(impl, "testOperationWithDefaultVariantArgument"_s, { variantDefaultArg }); |
| impl.testOperationWithDefaultVariantArgument(WTFMove(variantDefaultArg)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestCallTracerPrototypeFunctionTestOperationWithDefaultVariantArgument(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame) |
| { |
| return IDLOperation<JSTestCallTracer>::call<jsTestCallTracerPrototypeFunctionTestOperationWithDefaultVariantArgumentBody>(*lexicalGlobalObject, *callFrame, "testOperationWithDefaultVariantArgument"); |
| } |
| |
| void JSTestCallTracer::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer) |
| { |
| auto* thisObject = jsCast<JSTestCallTracer*>(cell); |
| analyzer.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
| if (thisObject->scriptExecutionContext()) |
| analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
| Base::analyzeHeap(cell, analyzer); |
| } |
| |
| bool JSTestCallTracerOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) |
| { |
| UNUSED_PARAM(handle); |
| UNUSED_PARAM(visitor); |
| UNUSED_PARAM(reason); |
| return false; |
| } |
| |
| void JSTestCallTracerOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
| { |
| auto* jsTestCallTracer = static_cast<JSTestCallTracer*>(handle.slot()->asCell()); |
| auto& world = *static_cast<DOMWrapperWorld*>(context); |
| uncacheWrapper(world, &jsTestCallTracer->wrapped(), jsTestCallTracer); |
| } |
| |
| #if ENABLE(BINDING_INTEGRITY) |
| #if PLATFORM(WIN) |
| #pragma warning(disable: 4483) |
| extern "C" { extern void (*const __identifier("??_7TestCallTracer@WebCore@@6B@")[])(); } |
| #else |
| extern "C" { extern void* _ZTVN7WebCore14TestCallTracerE[]; } |
| #endif |
| #endif |
| |
| JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref<TestCallTracer>&& impl) |
| { |
| |
| #if ENABLE(BINDING_INTEGRITY) |
| void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr())); |
| #if PLATFORM(WIN) |
| void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(__identifier("??_7TestCallTracer@WebCore@@6B@")); |
| #else |
| void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(&_ZTVN7WebCore14TestCallTracerE[2]); |
| #endif |
| |
| // If this fails TestCallTracer does not have a vtable, so you need to add the |
| // ImplementationLacksVTable attribute to the interface definition |
| static_assert(std::is_polymorphic<TestCallTracer>::value, "TestCallTracer is not polymorphic"); |
| |
| // If you hit this assertion you either have a use after free bug, or |
| // TestCallTracer has subclasses. If TestCallTracer has subclasses that get passed |
| // to toJS() we currently require TestCallTracer you to opt out of binding hardening |
| // by adding the SkipVTableValidation attribute to the interface IDL definition |
| RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); |
| #endif |
| return createWrapper<TestCallTracer>(globalObject, WTFMove(impl)); |
| } |
| |
| JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, TestCallTracer& impl) |
| { |
| return wrap(lexicalGlobalObject, globalObject, impl); |
| } |
| |
| TestCallTracer* JSTestCallTracer::toWrapped(JSC::VM& vm, JSC::JSValue value) |
| { |
| if (auto* wrapper = jsDynamicCast<JSTestCallTracer*>(vm, value)) |
| return &wrapper->wrapped(); |
| return nullptr; |
| } |
| |
| } |