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 "JSDOMQuad.h" |
23 | |
24 | #include "JSDOMAttribute.h" |
25 | #include "JSDOMBinding.h" |
26 | #include "JSDOMConstructor.h" |
27 | #include "JSDOMConvertDictionary.h" |
28 | #include "JSDOMConvertInterface.h" |
29 | #include "JSDOMExceptionHandling.h" |
30 | #include "JSDOMGlobalObject.h" |
31 | #include "JSDOMOperation.h" |
32 | #include "JSDOMPoint.h" |
33 | #include "JSDOMPointInit.h" |
34 | #include "JSDOMQuad.h" |
35 | #include "JSDOMQuadInit.h" |
36 | #include "JSDOMRect.h" |
37 | #include "JSDOMRectInit.h" |
38 | #include "JSDOMWrapperCache.h" |
39 | #include "ScriptExecutionContext.h" |
40 | #include <JavaScriptCore/FunctionPrototype.h> |
41 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
42 | #include <JavaScriptCore/JSCInlines.h> |
43 | #include <JavaScriptCore/ObjectConstructor.h> |
44 | #include <wtf/GetPtr.h> |
45 | #include <wtf/PointerPreparations.h> |
46 | #include <wtf/URL.h> |
47 | |
48 | |
49 | namespace WebCore { |
50 | using namespace JSC; |
51 | |
52 | // Functions |
53 | |
54 | JSC::EncodedJSValue JSC_HOST_CALL jsDOMQuadConstructorFunctionFromRect(JSC::ExecState*); |
55 | JSC::EncodedJSValue JSC_HOST_CALL jsDOMQuadConstructorFunctionFromQuad(JSC::ExecState*); |
56 | JSC::EncodedJSValue JSC_HOST_CALL jsDOMQuadPrototypeFunctionGetBounds(JSC::ExecState*); |
57 | JSC::EncodedJSValue JSC_HOST_CALL jsDOMQuadPrototypeFunctionToJSON(JSC::ExecState*); |
58 | |
59 | // Attributes |
60 | |
61 | JSC::EncodedJSValue jsDOMQuadConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
62 | bool setJSDOMQuadConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
63 | JSC::EncodedJSValue jsDOMQuadP1(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
64 | JSC::EncodedJSValue jsDOMQuadP2(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
65 | JSC::EncodedJSValue jsDOMQuadP3(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
66 | JSC::EncodedJSValue jsDOMQuadP4(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
67 | |
68 | class JSDOMQuadPrototype : public JSC::JSNonFinalObject { |
69 | public: |
70 | using Base = JSC::JSNonFinalObject; |
71 | static JSDOMQuadPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
72 | { |
73 | JSDOMQuadPrototype* ptr = new (NotNull, JSC::allocateCell<JSDOMQuadPrototype>(vm.heap)) JSDOMQuadPrototype(vm, globalObject, structure); |
74 | ptr->finishCreation(vm); |
75 | return ptr; |
76 | } |
77 | |
78 | DECLARE_INFO; |
79 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
80 | { |
81 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
82 | } |
83 | |
84 | private: |
85 | JSDOMQuadPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
86 | : JSC::JSNonFinalObject(vm, structure) |
87 | { |
88 | } |
89 | |
90 | void finishCreation(JSC::VM&); |
91 | }; |
92 | |
93 | using JSDOMQuadConstructor = JSDOMConstructor<JSDOMQuad>; |
94 | |
95 | /* Hash table for constructor */ |
96 | |
97 | static const HashTableValue JSDOMQuadConstructorTableValues[] = |
98 | { |
99 | { "fromRect" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsDOMQuadConstructorFunctionFromRect), (intptr_t) (0) } }, |
100 | { "fromQuad" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsDOMQuadConstructorFunctionFromQuad), (intptr_t) (0) } }, |
101 | }; |
102 | |
103 | template<> EncodedJSValue JSC_HOST_CALL JSDOMQuadConstructor::construct(ExecState* state) |
104 | { |
105 | VM& vm = state->vm(); |
106 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
107 | UNUSED_PARAM(throwScope); |
108 | auto* castedThis = jsCast<JSDOMQuadConstructor*>(state->jsCallee()); |
109 | ASSERT(castedThis); |
110 | auto p1 = convert<IDLDictionary<DOMPointInit>>(*state, state->argument(0)); |
111 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
112 | auto p2 = convert<IDLDictionary<DOMPointInit>>(*state, state->argument(1)); |
113 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
114 | auto p3 = convert<IDLDictionary<DOMPointInit>>(*state, state->argument(2)); |
115 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
116 | auto p4 = convert<IDLDictionary<DOMPointInit>>(*state, state->argument(3)); |
117 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
118 | auto object = DOMQuad::create(WTFMove(p1), WTFMove(p2), WTFMove(p3), WTFMove(p4)); |
119 | return JSValue::encode(toJSNewlyCreated<IDLInterface<DOMQuad>>(*state, *castedThis->globalObject(), WTFMove(object))); |
120 | } |
121 | |
122 | template<> JSValue JSDOMQuadConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
123 | { |
124 | UNUSED_PARAM(vm); |
125 | return globalObject.functionPrototype(); |
126 | } |
127 | |
128 | template<> void JSDOMQuadConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
129 | { |
130 | putDirect(vm, vm.propertyNames->prototype, JSDOMQuad::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
131 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("DOMQuad"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
132 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
133 | reifyStaticProperties(vm, JSDOMQuad::info(), JSDOMQuadConstructorTableValues, *this); |
134 | } |
135 | |
136 | template<> const ClassInfo JSDOMQuadConstructor::s_info = { "DOMQuad" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDOMQuadConstructor) }; |
137 | |
138 | /* Hash table for prototype */ |
139 | |
140 | static const HashTableValue JSDOMQuadPrototypeTableValues[] = |
141 | { |
142 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMQuadConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSDOMQuadConstructor) } }, |
143 | { "p1" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMQuadP1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
144 | { "p2" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMQuadP2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
145 | { "p3" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMQuadP3), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
146 | { "p4" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMQuadP4), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
147 | { "getBounds" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsDOMQuadPrototypeFunctionGetBounds), (intptr_t) (0) } }, |
148 | { "toJSON" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsDOMQuadPrototypeFunctionToJSON), (intptr_t) (0) } }, |
149 | }; |
150 | |
151 | const ClassInfo JSDOMQuadPrototype::s_info = { "DOMQuadPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDOMQuadPrototype) }; |
152 | |
153 | void JSDOMQuadPrototype::finishCreation(VM& vm) |
154 | { |
155 | Base::finishCreation(vm); |
156 | reifyStaticProperties(vm, JSDOMQuad::info(), JSDOMQuadPrototypeTableValues, *this); |
157 | } |
158 | |
159 | const ClassInfo JSDOMQuad::s_info = { "DOMQuad" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDOMQuad) }; |
160 | |
161 | JSDOMQuad::JSDOMQuad(Structure* structure, JSDOMGlobalObject& globalObject, Ref<DOMQuad>&& impl) |
162 | : JSDOMWrapper<DOMQuad>(structure, globalObject, WTFMove(impl)) |
163 | { |
164 | } |
165 | |
166 | void JSDOMQuad::finishCreation(VM& vm) |
167 | { |
168 | Base::finishCreation(vm); |
169 | ASSERT(inherits(vm, info())); |
170 | |
171 | } |
172 | |
173 | JSObject* JSDOMQuad::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
174 | { |
175 | return JSDOMQuadPrototype::create(vm, &globalObject, JSDOMQuadPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); |
176 | } |
177 | |
178 | JSObject* JSDOMQuad::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
179 | { |
180 | return getDOMPrototype<JSDOMQuad>(vm, globalObject); |
181 | } |
182 | |
183 | JSValue JSDOMQuad::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
184 | { |
185 | return getDOMConstructor<JSDOMQuadConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
186 | } |
187 | |
188 | void JSDOMQuad::destroy(JSC::JSCell* cell) |
189 | { |
190 | JSDOMQuad* thisObject = static_cast<JSDOMQuad*>(cell); |
191 | thisObject->JSDOMQuad::~JSDOMQuad(); |
192 | } |
193 | |
194 | template<> inline JSDOMQuad* IDLAttribute<JSDOMQuad>::cast(ExecState& state, EncodedJSValue thisValue) |
195 | { |
196 | return jsDynamicCast<JSDOMQuad*>(state.vm(), JSValue::decode(thisValue)); |
197 | } |
198 | |
199 | template<> inline JSDOMQuad* IDLOperation<JSDOMQuad>::cast(ExecState& state) |
200 | { |
201 | return jsDynamicCast<JSDOMQuad*>(state.vm(), state.thisValue()); |
202 | } |
203 | |
204 | EncodedJSValue jsDOMQuadConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
205 | { |
206 | VM& vm = state->vm(); |
207 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
208 | auto* prototype = jsDynamicCast<JSDOMQuadPrototype*>(vm, JSValue::decode(thisValue)); |
209 | if (UNLIKELY(!prototype)) |
210 | return throwVMTypeError(state, throwScope); |
211 | return JSValue::encode(JSDOMQuad::getConstructor(state->vm(), prototype->globalObject())); |
212 | } |
213 | |
214 | bool setJSDOMQuadConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
215 | { |
216 | VM& vm = state->vm(); |
217 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
218 | auto* prototype = jsDynamicCast<JSDOMQuadPrototype*>(vm, JSValue::decode(thisValue)); |
219 | if (UNLIKELY(!prototype)) { |
220 | throwVMTypeError(state, throwScope); |
221 | return false; |
222 | } |
223 | // Shadowing a built-in constructor |
224 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
225 | } |
226 | |
227 | static inline JSValue jsDOMQuadP1Getter(ExecState& state, JSDOMQuad& thisObject, ThrowScope& throwScope) |
228 | { |
229 | UNUSED_PARAM(throwScope); |
230 | UNUSED_PARAM(state); |
231 | auto& impl = thisObject.wrapped(); |
232 | JSValue result = toJS<IDLInterface<DOMPoint>>(state, *thisObject.globalObject(), throwScope, impl.p1()); |
233 | return result; |
234 | } |
235 | |
236 | EncodedJSValue jsDOMQuadP1(ExecState* state, EncodedJSValue thisValue, PropertyName) |
237 | { |
238 | return IDLAttribute<JSDOMQuad>::get<jsDOMQuadP1Getter, CastedThisErrorBehavior::Assert>(*state, thisValue, "p1" ); |
239 | } |
240 | |
241 | static inline JSValue jsDOMQuadP2Getter(ExecState& state, JSDOMQuad& thisObject, ThrowScope& throwScope) |
242 | { |
243 | UNUSED_PARAM(throwScope); |
244 | UNUSED_PARAM(state); |
245 | auto& impl = thisObject.wrapped(); |
246 | JSValue result = toJS<IDLInterface<DOMPoint>>(state, *thisObject.globalObject(), throwScope, impl.p2()); |
247 | return result; |
248 | } |
249 | |
250 | EncodedJSValue jsDOMQuadP2(ExecState* state, EncodedJSValue thisValue, PropertyName) |
251 | { |
252 | return IDLAttribute<JSDOMQuad>::get<jsDOMQuadP2Getter, CastedThisErrorBehavior::Assert>(*state, thisValue, "p2" ); |
253 | } |
254 | |
255 | static inline JSValue jsDOMQuadP3Getter(ExecState& state, JSDOMQuad& thisObject, ThrowScope& throwScope) |
256 | { |
257 | UNUSED_PARAM(throwScope); |
258 | UNUSED_PARAM(state); |
259 | auto& impl = thisObject.wrapped(); |
260 | JSValue result = toJS<IDLInterface<DOMPoint>>(state, *thisObject.globalObject(), throwScope, impl.p3()); |
261 | return result; |
262 | } |
263 | |
264 | EncodedJSValue jsDOMQuadP3(ExecState* state, EncodedJSValue thisValue, PropertyName) |
265 | { |
266 | return IDLAttribute<JSDOMQuad>::get<jsDOMQuadP3Getter, CastedThisErrorBehavior::Assert>(*state, thisValue, "p3" ); |
267 | } |
268 | |
269 | static inline JSValue jsDOMQuadP4Getter(ExecState& state, JSDOMQuad& thisObject, ThrowScope& throwScope) |
270 | { |
271 | UNUSED_PARAM(throwScope); |
272 | UNUSED_PARAM(state); |
273 | auto& impl = thisObject.wrapped(); |
274 | JSValue result = toJS<IDLInterface<DOMPoint>>(state, *thisObject.globalObject(), throwScope, impl.p4()); |
275 | return result; |
276 | } |
277 | |
278 | EncodedJSValue jsDOMQuadP4(ExecState* state, EncodedJSValue thisValue, PropertyName) |
279 | { |
280 | return IDLAttribute<JSDOMQuad>::get<jsDOMQuadP4Getter, CastedThisErrorBehavior::Assert>(*state, thisValue, "p4" ); |
281 | } |
282 | |
283 | static inline JSC::EncodedJSValue jsDOMQuadConstructorFunctionFromRectBody(JSC::ExecState* state, JSC::ThrowScope& throwScope) |
284 | { |
285 | UNUSED_PARAM(state); |
286 | UNUSED_PARAM(throwScope); |
287 | auto other = convert<IDLDictionary<DOMRectInit>>(*state, state->argument(0)); |
288 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
289 | return JSValue::encode(toJSNewlyCreated<IDLInterface<DOMQuad>>(*state, *jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), DOMQuad::fromRect(WTFMove(other)))); |
290 | } |
291 | |
292 | EncodedJSValue JSC_HOST_CALL jsDOMQuadConstructorFunctionFromRect(ExecState* state) |
293 | { |
294 | return IDLOperation<JSDOMQuad>::callStatic<jsDOMQuadConstructorFunctionFromRectBody>(*state, "fromRect" ); |
295 | } |
296 | |
297 | static inline JSC::EncodedJSValue jsDOMQuadConstructorFunctionFromQuadBody(JSC::ExecState* state, JSC::ThrowScope& throwScope) |
298 | { |
299 | UNUSED_PARAM(state); |
300 | UNUSED_PARAM(throwScope); |
301 | auto other = convert<IDLDictionary<DOMQuadInit>>(*state, state->argument(0)); |
302 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
303 | return JSValue::encode(toJSNewlyCreated<IDLInterface<DOMQuad>>(*state, *jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), DOMQuad::fromQuad(WTFMove(other)))); |
304 | } |
305 | |
306 | EncodedJSValue JSC_HOST_CALL jsDOMQuadConstructorFunctionFromQuad(ExecState* state) |
307 | { |
308 | return IDLOperation<JSDOMQuad>::callStatic<jsDOMQuadConstructorFunctionFromQuadBody>(*state, "fromQuad" ); |
309 | } |
310 | |
311 | static inline JSC::EncodedJSValue jsDOMQuadPrototypeFunctionGetBoundsBody(JSC::ExecState* state, typename IDLOperation<JSDOMQuad>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
312 | { |
313 | UNUSED_PARAM(state); |
314 | UNUSED_PARAM(throwScope); |
315 | auto& impl = castedThis->wrapped(); |
316 | return JSValue::encode(toJSNewlyCreated<IDLInterface<DOMRect>>(*state, *castedThis->globalObject(), impl.getBounds())); |
317 | } |
318 | |
319 | EncodedJSValue JSC_HOST_CALL jsDOMQuadPrototypeFunctionGetBounds(ExecState* state) |
320 | { |
321 | return IDLOperation<JSDOMQuad>::call<jsDOMQuadPrototypeFunctionGetBoundsBody>(*state, "getBounds" ); |
322 | } |
323 | |
324 | JSC::JSObject* JSDOMQuad::serialize(ExecState& state, JSDOMQuad& thisObject, JSDOMGlobalObject& globalObject, ThrowScope& throwScope) |
325 | { |
326 | auto& vm = state.vm(); |
327 | auto* result = constructEmptyObject(&state, globalObject.objectPrototype()); |
328 | |
329 | auto p1Value = jsDOMQuadP1Getter(state, thisObject, throwScope); |
330 | throwScope.assertNoException(); |
331 | auto* p1SerializedValue = JSDOMPoint::serialize(state, *jsCast<JSDOMPoint*>(p1Value), globalObject, throwScope); |
332 | result->putDirect(vm, Identifier::fromString(&vm, "p1" ), p1SerializedValue); |
333 | |
334 | auto p2Value = jsDOMQuadP2Getter(state, thisObject, throwScope); |
335 | throwScope.assertNoException(); |
336 | auto* p2SerializedValue = JSDOMPoint::serialize(state, *jsCast<JSDOMPoint*>(p2Value), globalObject, throwScope); |
337 | result->putDirect(vm, Identifier::fromString(&vm, "p2" ), p2SerializedValue); |
338 | |
339 | auto p3Value = jsDOMQuadP3Getter(state, thisObject, throwScope); |
340 | throwScope.assertNoException(); |
341 | auto* p3SerializedValue = JSDOMPoint::serialize(state, *jsCast<JSDOMPoint*>(p3Value), globalObject, throwScope); |
342 | result->putDirect(vm, Identifier::fromString(&vm, "p3" ), p3SerializedValue); |
343 | |
344 | auto p4Value = jsDOMQuadP4Getter(state, thisObject, throwScope); |
345 | throwScope.assertNoException(); |
346 | auto* p4SerializedValue = JSDOMPoint::serialize(state, *jsCast<JSDOMPoint*>(p4Value), globalObject, throwScope); |
347 | result->putDirect(vm, Identifier::fromString(&vm, "p4" ), p4SerializedValue); |
348 | |
349 | return result; |
350 | } |
351 | |
352 | static inline EncodedJSValue jsDOMQuadPrototypeFunctionToJSONBody(ExecState* state, JSDOMQuad* thisObject, JSC::ThrowScope& throwScope) |
353 | { |
354 | return JSValue::encode(JSDOMQuad::serialize(*state, *thisObject, *thisObject->globalObject(), throwScope)); |
355 | } |
356 | |
357 | EncodedJSValue JSC_HOST_CALL jsDOMQuadPrototypeFunctionToJSON(ExecState* state) |
358 | { |
359 | return IDLOperation<JSDOMQuad>::call<jsDOMQuadPrototypeFunctionToJSONBody>(*state, "toJSON" ); |
360 | } |
361 | |
362 | void JSDOMQuad::visitChildren(JSCell* cell, SlotVisitor& visitor) |
363 | { |
364 | auto* thisObject = jsCast<JSDOMQuad*>(cell); |
365 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
366 | Base::visitChildren(thisObject, visitor); |
367 | thisObject->visitAdditionalChildren(visitor); |
368 | } |
369 | |
370 | void JSDOMQuad::visitOutputConstraints(JSCell* cell, SlotVisitor& visitor) |
371 | { |
372 | auto* thisObject = jsCast<JSDOMQuad*>(cell); |
373 | ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
374 | Base::visitOutputConstraints(thisObject, visitor); |
375 | thisObject->visitAdditionalChildren(visitor); |
376 | } |
377 | |
378 | void JSDOMQuad::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
379 | { |
380 | auto* thisObject = jsCast<JSDOMQuad*>(cell); |
381 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
382 | if (thisObject->scriptExecutionContext()) |
383 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
384 | Base::heapSnapshot(cell, builder); |
385 | } |
386 | |
387 | bool JSDOMQuadOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) |
388 | { |
389 | UNUSED_PARAM(handle); |
390 | UNUSED_PARAM(visitor); |
391 | UNUSED_PARAM(reason); |
392 | return false; |
393 | } |
394 | |
395 | void JSDOMQuadOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
396 | { |
397 | auto* jsDOMQuad = static_cast<JSDOMQuad*>(handle.slot()->asCell()); |
398 | auto& world = *static_cast<DOMWrapperWorld*>(context); |
399 | uncacheWrapper(world, &jsDOMQuad->wrapped(), jsDOMQuad); |
400 | } |
401 | |
402 | JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<DOMQuad>&& impl) |
403 | { |
404 | // If you hit this failure the interface definition has the ImplementationLacksVTable |
405 | // attribute. You should remove that attribute. If the class has subclasses |
406 | // that may be passed through this toJS() function you should use the SkipVTableValidation |
407 | // attribute to DOMQuad. |
408 | static_assert(!std::is_polymorphic<DOMQuad>::value, "DOMQuad is polymorphic but the IDL claims it is not" ); |
409 | return createWrapper<DOMQuad>(globalObject, WTFMove(impl)); |
410 | } |
411 | |
412 | JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, DOMQuad& impl) |
413 | { |
414 | return wrap(state, globalObject, impl); |
415 | } |
416 | |
417 | DOMQuad* JSDOMQuad::toWrapped(JSC::VM& vm, JSC::JSValue value) |
418 | { |
419 | if (auto* wrapper = jsDynamicCast<JSDOMQuad*>(vm, value)) |
420 | return &wrapper->wrapped(); |
421 | return nullptr; |
422 | } |
423 | |
424 | } |
425 | |