1/*
2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#include "config.h"
22#include "JSInspectorAuditDOMObject.h"
23
24#include "JSDOMBinding.h"
25#include "JSDOMConvertBoolean.h"
26#include "JSDOMConvertInterface.h"
27#include "JSDOMConvertStrings.h"
28#include "JSDOMExceptionHandling.h"
29#include "JSDOMOperation.h"
30#include "JSDOMWrapperCache.h"
31#include "JSNode.h"
32#include "ScriptExecutionContext.h"
33#include <JavaScriptCore/HeapSnapshotBuilder.h>
34#include <JavaScriptCore/JSCInlines.h>
35#include <wtf/GetPtr.h>
36#include <wtf/PointerPreparations.h>
37#include <wtf/URL.h>
38
39
40namespace WebCore {
41using namespace JSC;
42
43// Functions
44
45JSC::EncodedJSValue JSC_HOST_CALL jsInspectorAuditDOMObjectPrototypeFunctionHasEventListeners(JSC::ExecState*);
46
47class JSInspectorAuditDOMObjectPrototype : public JSC::JSNonFinalObject {
48public:
49 using Base = JSC::JSNonFinalObject;
50 static JSInspectorAuditDOMObjectPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
51 {
52 JSInspectorAuditDOMObjectPrototype* ptr = new (NotNull, JSC::allocateCell<JSInspectorAuditDOMObjectPrototype>(vm.heap)) JSInspectorAuditDOMObjectPrototype(vm, globalObject, structure);
53 ptr->finishCreation(vm);
54 return ptr;
55 }
56
57 DECLARE_INFO;
58 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
59 {
60 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
61 }
62
63private:
64 JSInspectorAuditDOMObjectPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
65 : JSC::JSNonFinalObject(vm, structure)
66 {
67 }
68
69 void finishCreation(JSC::VM&);
70};
71
72/* Hash table for prototype */
73
74static const HashTableValue JSInspectorAuditDOMObjectPrototypeTableValues[] =
75{
76 { "hasEventListeners", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorAuditDOMObjectPrototypeFunctionHasEventListeners), (intptr_t) (1) } },
77};
78
79const ClassInfo JSInspectorAuditDOMObjectPrototype::s_info = { "InspectorAuditDOMObjectPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSInspectorAuditDOMObjectPrototype) };
80
81void JSInspectorAuditDOMObjectPrototype::finishCreation(VM& vm)
82{
83 Base::finishCreation(vm);
84 reifyStaticProperties(vm, JSInspectorAuditDOMObject::info(), JSInspectorAuditDOMObjectPrototypeTableValues, *this);
85}
86
87const ClassInfo JSInspectorAuditDOMObject::s_info = { "InspectorAuditDOMObject", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSInspectorAuditDOMObject) };
88
89JSInspectorAuditDOMObject::JSInspectorAuditDOMObject(Structure* structure, JSDOMGlobalObject& globalObject, Ref<InspectorAuditDOMObject>&& impl)
90 : JSDOMWrapper<InspectorAuditDOMObject>(structure, globalObject, WTFMove(impl))
91{
92}
93
94void JSInspectorAuditDOMObject::finishCreation(VM& vm)
95{
96 Base::finishCreation(vm);
97 ASSERT(inherits(vm, info()));
98
99}
100
101JSObject* JSInspectorAuditDOMObject::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
102{
103 return JSInspectorAuditDOMObjectPrototype::create(vm, &globalObject, JSInspectorAuditDOMObjectPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
104}
105
106JSObject* JSInspectorAuditDOMObject::prototype(VM& vm, JSDOMGlobalObject& globalObject)
107{
108 return getDOMPrototype<JSInspectorAuditDOMObject>(vm, globalObject);
109}
110
111void JSInspectorAuditDOMObject::destroy(JSC::JSCell* cell)
112{
113 JSInspectorAuditDOMObject* thisObject = static_cast<JSInspectorAuditDOMObject*>(cell);
114 thisObject->JSInspectorAuditDOMObject::~JSInspectorAuditDOMObject();
115}
116
117template<> inline JSInspectorAuditDOMObject* IDLOperation<JSInspectorAuditDOMObject>::cast(ExecState& state)
118{
119 return jsDynamicCast<JSInspectorAuditDOMObject*>(state.vm(), state.thisValue());
120}
121
122static inline JSC::EncodedJSValue jsInspectorAuditDOMObjectPrototypeFunctionHasEventListenersBody(JSC::ExecState* state, typename IDLOperation<JSInspectorAuditDOMObject>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
123{
124 UNUSED_PARAM(state);
125 UNUSED_PARAM(throwScope);
126 auto& impl = castedThis->wrapped();
127 if (UNLIKELY(state->argumentCount() < 1))
128 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
129 auto node = convert<IDLInterface<Node>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "node", "InspectorAuditDOMObject", "hasEventListeners", "Node"); });
130 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
131 auto type = state->argument(1).isUndefined() ? String() : convert<IDLDOMString>(*state, state->uncheckedArgument(1));
132 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
133 return JSValue::encode(toJS<IDLBoolean>(*state, throwScope, impl.hasEventListeners(*node, WTFMove(type))));
134}
135
136EncodedJSValue JSC_HOST_CALL jsInspectorAuditDOMObjectPrototypeFunctionHasEventListeners(ExecState* state)
137{
138 return IDLOperation<JSInspectorAuditDOMObject>::call<jsInspectorAuditDOMObjectPrototypeFunctionHasEventListenersBody>(*state, "hasEventListeners");
139}
140
141void JSInspectorAuditDOMObject::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)
142{
143 auto* thisObject = jsCast<JSInspectorAuditDOMObject*>(cell);
144 builder.setWrappedObjectForCell(cell, &thisObject->wrapped());
145 if (thisObject->scriptExecutionContext())
146 builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
147 Base::heapSnapshot(cell, builder);
148}
149
150bool JSInspectorAuditDOMObjectOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason)
151{
152 UNUSED_PARAM(handle);
153 UNUSED_PARAM(visitor);
154 UNUSED_PARAM(reason);
155 return false;
156}
157
158void JSInspectorAuditDOMObjectOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
159{
160 auto* jsInspectorAuditDOMObject = static_cast<JSInspectorAuditDOMObject*>(handle.slot()->asCell());
161 auto& world = *static_cast<DOMWrapperWorld*>(context);
162 uncacheWrapper(world, &jsInspectorAuditDOMObject->wrapped(), jsInspectorAuditDOMObject);
163}
164
165JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<InspectorAuditDOMObject>&& impl)
166{
167 // If you hit this failure the interface definition has the ImplementationLacksVTable
168 // attribute. You should remove that attribute. If the class has subclasses
169 // that may be passed through this toJS() function you should use the SkipVTableValidation
170 // attribute to InspectorAuditDOMObject.
171 static_assert(!std::is_polymorphic<InspectorAuditDOMObject>::value, "InspectorAuditDOMObject is polymorphic but the IDL claims it is not");
172 return createWrapper<InspectorAuditDOMObject>(globalObject, WTFMove(impl));
173}
174
175JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, InspectorAuditDOMObject& impl)
176{
177 return wrap(state, globalObject, impl);
178}
179
180InspectorAuditDOMObject* JSInspectorAuditDOMObject::toWrapped(JSC::VM& vm, JSC::JSValue value)
181{
182 if (auto* wrapper = jsDynamicCast<JSInspectorAuditDOMObject*>(vm, value))
183 return &wrapper->wrapped();
184 return nullptr;
185}
186
187}
188