| /* |
| 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 "JSMockPageOverlay.h" |
| |
| #include "ExceptionCode.h" |
| #include "JSDOMBinding.h" |
| #include "JSDOMConvert.h" |
| #include <runtime/Error.h> |
| #include <wtf/GetPtr.h> |
| |
| using namespace JSC; |
| |
| namespace WebCore { |
| |
| // Functions |
| |
| JSC::EncodedJSValue JSC_HOST_CALL jsMockPageOverlayPrototypeFunctionSetFrame(JSC::ExecState*); |
| |
| class JSMockPageOverlayPrototype : public JSC::JSNonFinalObject { |
| public: |
| typedef JSC::JSNonFinalObject Base; |
| static JSMockPageOverlayPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) |
| { |
| JSMockPageOverlayPrototype* ptr = new (NotNull, JSC::allocateCell<JSMockPageOverlayPrototype>(vm.heap)) JSMockPageOverlayPrototype(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: |
| JSMockPageOverlayPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
| : JSC::JSNonFinalObject(vm, structure) |
| { |
| } |
| |
| void finishCreation(JSC::VM&); |
| }; |
| |
| /* Hash table for prototype */ |
| |
| static const HashTableValue JSMockPageOverlayPrototypeTableValues[] = |
| { |
| { "setFrame", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsMockPageOverlayPrototypeFunctionSetFrame), (intptr_t) (4) } }, |
| }; |
| |
| const ClassInfo JSMockPageOverlayPrototype::s_info = { "MockPageOverlayPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSMockPageOverlayPrototype) }; |
| |
| void JSMockPageOverlayPrototype::finishCreation(VM& vm) |
| { |
| Base::finishCreation(vm); |
| reifyStaticProperties(vm, JSMockPageOverlayPrototypeTableValues, *this); |
| } |
| |
| const ClassInfo JSMockPageOverlay::s_info = { "MockPageOverlay", &Base::s_info, 0, CREATE_METHOD_TABLE(JSMockPageOverlay) }; |
| |
| JSMockPageOverlay::JSMockPageOverlay(Structure* structure, JSDOMGlobalObject& globalObject, Ref<MockPageOverlay>&& impl) |
| : JSDOMWrapper<MockPageOverlay>(structure, globalObject, WTFMove(impl)) |
| { |
| } |
| |
| JSObject* JSMockPageOverlay::createPrototype(VM& vm, JSGlobalObject* globalObject) |
| { |
| return JSMockPageOverlayPrototype::create(vm, globalObject, JSMockPageOverlayPrototype::createStructure(vm, globalObject, globalObject->objectPrototype())); |
| } |
| |
| JSObject* JSMockPageOverlay::prototype(VM& vm, JSGlobalObject* globalObject) |
| { |
| return getDOMPrototype<JSMockPageOverlay>(vm, globalObject); |
| } |
| |
| void JSMockPageOverlay::destroy(JSC::JSCell* cell) |
| { |
| JSMockPageOverlay* thisObject = static_cast<JSMockPageOverlay*>(cell); |
| thisObject->JSMockPageOverlay::~JSMockPageOverlay(); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsMockPageOverlayPrototypeFunctionSetFrame(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSMockPageOverlay*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "MockPageOverlay", "setFrame"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSMockPageOverlay::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 4)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto x = convert<double>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::No); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto y = convert<double>(*state, state->uncheckedArgument(1), ShouldAllowNonFinite::No); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto width = convert<double>(*state, state->uncheckedArgument(2), ShouldAllowNonFinite::No); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto height = convert<double>(*state, state->uncheckedArgument(3), ShouldAllowNonFinite::No); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.setFrame(WTFMove(x), WTFMove(y), WTFMove(width), WTFMove(height)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| bool JSMockPageOverlayOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) |
| { |
| UNUSED_PARAM(handle); |
| UNUSED_PARAM(visitor); |
| return false; |
| } |
| |
| void JSMockPageOverlayOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
| { |
| auto* jsMockPageOverlay = jsCast<JSMockPageOverlay*>(handle.slot()->asCell()); |
| auto& world = *static_cast<DOMWrapperWorld*>(context); |
| uncacheWrapper(world, &jsMockPageOverlay->wrapped(), jsMockPageOverlay); |
| } |
| |
| JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<MockPageOverlay>&& impl) |
| { |
| #if COMPILER(CLANG) |
| // If you hit this failure the interface definition has the ImplementationLacksVTable |
| // attribute. You should remove that attribute. If the class has subclasses |
| // that may be passed through this toJS() function you should use the SkipVTableValidation |
| // attribute to MockPageOverlay. |
| static_assert(!__is_polymorphic(MockPageOverlay), "MockPageOverlay is polymorphic but the IDL claims it is not"); |
| #endif |
| return createWrapper<MockPageOverlay>(globalObject, WTFMove(impl)); |
| } |
| |
| JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, MockPageOverlay& impl) |
| { |
| return wrap(state, globalObject, impl); |
| } |
| |
| MockPageOverlay* JSMockPageOverlay::toWrapped(JSC::JSValue value) |
| { |
| if (auto* wrapper = jsDynamicCast<JSMockPageOverlay*>(value)) |
| return &wrapper->wrapped(); |
| return nullptr; |
| } |
| |
| } |