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 "JSSVGNumberList.h" |
23 | |
24 | #include "JSDOMAttribute.h" |
25 | #include "JSDOMBinding.h" |
26 | #include "JSDOMConstructorNotConstructable.h" |
27 | #include "JSDOMConvertInterface.h" |
28 | #include "JSDOMConvertNumbers.h" |
29 | #include "JSDOMExceptionHandling.h" |
30 | #include "JSDOMGlobalObject.h" |
31 | #include "JSDOMOperation.h" |
32 | #include "JSDOMWrapperCache.h" |
33 | #include "JSSVGNumber.h" |
34 | #include "ScriptExecutionContext.h" |
35 | #include <JavaScriptCore/FunctionPrototype.h> |
36 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
37 | #include <JavaScriptCore/JSCInlines.h> |
38 | #include <wtf/GetPtr.h> |
39 | #include <wtf/PointerPreparations.h> |
40 | #include <wtf/URL.h> |
41 | |
42 | |
43 | namespace WebCore { |
44 | using namespace JSC; |
45 | |
46 | // Functions |
47 | |
48 | JSC::EncodedJSValue JSC_HOST_CALL jsSVGNumberListPrototypeFunctionClear(JSC::ExecState*); |
49 | JSC::EncodedJSValue JSC_HOST_CALL jsSVGNumberListPrototypeFunctionInitialize(JSC::ExecState*); |
50 | JSC::EncodedJSValue JSC_HOST_CALL jsSVGNumberListPrototypeFunctionGetItem(JSC::ExecState*); |
51 | JSC::EncodedJSValue JSC_HOST_CALL jsSVGNumberListPrototypeFunctionInsertItemBefore(JSC::ExecState*); |
52 | JSC::EncodedJSValue JSC_HOST_CALL jsSVGNumberListPrototypeFunctionReplaceItem(JSC::ExecState*); |
53 | JSC::EncodedJSValue JSC_HOST_CALL jsSVGNumberListPrototypeFunctionRemoveItem(JSC::ExecState*); |
54 | JSC::EncodedJSValue JSC_HOST_CALL jsSVGNumberListPrototypeFunctionAppendItem(JSC::ExecState*); |
55 | |
56 | // Attributes |
57 | |
58 | JSC::EncodedJSValue jsSVGNumberListConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
59 | bool setJSSVGNumberListConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
60 | JSC::EncodedJSValue jsSVGNumberListNumberOfItems(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
61 | |
62 | class JSSVGNumberListPrototype : public JSC::JSNonFinalObject { |
63 | public: |
64 | using Base = JSC::JSNonFinalObject; |
65 | static JSSVGNumberListPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
66 | { |
67 | JSSVGNumberListPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGNumberListPrototype>(vm.heap)) JSSVGNumberListPrototype(vm, globalObject, structure); |
68 | ptr->finishCreation(vm); |
69 | return ptr; |
70 | } |
71 | |
72 | DECLARE_INFO; |
73 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
74 | { |
75 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
76 | } |
77 | |
78 | private: |
79 | JSSVGNumberListPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
80 | : JSC::JSNonFinalObject(vm, structure) |
81 | { |
82 | } |
83 | |
84 | void finishCreation(JSC::VM&); |
85 | }; |
86 | |
87 | using JSSVGNumberListConstructor = JSDOMConstructorNotConstructable<JSSVGNumberList>; |
88 | |
89 | template<> JSValue JSSVGNumberListConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
90 | { |
91 | UNUSED_PARAM(vm); |
92 | return globalObject.functionPrototype(); |
93 | } |
94 | |
95 | template<> void JSSVGNumberListConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
96 | { |
97 | putDirect(vm, vm.propertyNames->prototype, JSSVGNumberList::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
98 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGNumberList"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
99 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
100 | } |
101 | |
102 | template<> const ClassInfo JSSVGNumberListConstructor::s_info = { "SVGNumberList" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGNumberListConstructor) }; |
103 | |
104 | /* Hash table for prototype */ |
105 | |
106 | static const HashTableValue JSSVGNumberListPrototypeTableValues[] = |
107 | { |
108 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGNumberListConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGNumberListConstructor) } }, |
109 | { "numberOfItems" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGNumberListNumberOfItems), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
110 | { "clear" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGNumberListPrototypeFunctionClear), (intptr_t) (0) } }, |
111 | { "initialize" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGNumberListPrototypeFunctionInitialize), (intptr_t) (1) } }, |
112 | { "getItem" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGNumberListPrototypeFunctionGetItem), (intptr_t) (1) } }, |
113 | { "insertItemBefore" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGNumberListPrototypeFunctionInsertItemBefore), (intptr_t) (2) } }, |
114 | { "replaceItem" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGNumberListPrototypeFunctionReplaceItem), (intptr_t) (2) } }, |
115 | { "removeItem" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGNumberListPrototypeFunctionRemoveItem), (intptr_t) (1) } }, |
116 | { "appendItem" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsSVGNumberListPrototypeFunctionAppendItem), (intptr_t) (1) } }, |
117 | }; |
118 | |
119 | const ClassInfo JSSVGNumberListPrototype::s_info = { "SVGNumberListPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGNumberListPrototype) }; |
120 | |
121 | void JSSVGNumberListPrototype::finishCreation(VM& vm) |
122 | { |
123 | Base::finishCreation(vm); |
124 | reifyStaticProperties(vm, JSSVGNumberList::info(), JSSVGNumberListPrototypeTableValues, *this); |
125 | } |
126 | |
127 | const ClassInfo JSSVGNumberList::s_info = { "SVGNumberList" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGNumberList) }; |
128 | |
129 | JSSVGNumberList::JSSVGNumberList(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGNumberList>&& impl) |
130 | : JSDOMWrapper<SVGNumberList>(structure, globalObject, WTFMove(impl)) |
131 | { |
132 | } |
133 | |
134 | void JSSVGNumberList::finishCreation(VM& vm) |
135 | { |
136 | Base::finishCreation(vm); |
137 | ASSERT(inherits(vm, info())); |
138 | |
139 | } |
140 | |
141 | JSObject* JSSVGNumberList::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
142 | { |
143 | return JSSVGNumberListPrototype::create(vm, &globalObject, JSSVGNumberListPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); |
144 | } |
145 | |
146 | JSObject* JSSVGNumberList::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
147 | { |
148 | return getDOMPrototype<JSSVGNumberList>(vm, globalObject); |
149 | } |
150 | |
151 | JSValue JSSVGNumberList::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
152 | { |
153 | return getDOMConstructor<JSSVGNumberListConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
154 | } |
155 | |
156 | void JSSVGNumberList::destroy(JSC::JSCell* cell) |
157 | { |
158 | JSSVGNumberList* thisObject = static_cast<JSSVGNumberList*>(cell); |
159 | thisObject->JSSVGNumberList::~JSSVGNumberList(); |
160 | } |
161 | |
162 | template<> inline JSSVGNumberList* IDLAttribute<JSSVGNumberList>::cast(ExecState& state, EncodedJSValue thisValue) |
163 | { |
164 | return jsDynamicCast<JSSVGNumberList*>(state.vm(), JSValue::decode(thisValue)); |
165 | } |
166 | |
167 | template<> inline JSSVGNumberList* IDLOperation<JSSVGNumberList>::cast(ExecState& state) |
168 | { |
169 | return jsDynamicCast<JSSVGNumberList*>(state.vm(), state.thisValue()); |
170 | } |
171 | |
172 | EncodedJSValue jsSVGNumberListConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
173 | { |
174 | VM& vm = state->vm(); |
175 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
176 | auto* prototype = jsDynamicCast<JSSVGNumberListPrototype*>(vm, JSValue::decode(thisValue)); |
177 | if (UNLIKELY(!prototype)) |
178 | return throwVMTypeError(state, throwScope); |
179 | return JSValue::encode(JSSVGNumberList::getConstructor(state->vm(), prototype->globalObject())); |
180 | } |
181 | |
182 | bool setJSSVGNumberListConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
183 | { |
184 | VM& vm = state->vm(); |
185 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
186 | auto* prototype = jsDynamicCast<JSSVGNumberListPrototype*>(vm, JSValue::decode(thisValue)); |
187 | if (UNLIKELY(!prototype)) { |
188 | throwVMTypeError(state, throwScope); |
189 | return false; |
190 | } |
191 | // Shadowing a built-in constructor |
192 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
193 | } |
194 | |
195 | static inline JSValue jsSVGNumberListNumberOfItemsGetter(ExecState& state, JSSVGNumberList& thisObject, ThrowScope& throwScope) |
196 | { |
197 | UNUSED_PARAM(throwScope); |
198 | UNUSED_PARAM(state); |
199 | auto& impl = thisObject.wrapped(); |
200 | JSValue result = toJS<IDLUnsignedLong>(state, throwScope, impl.numberOfItems()); |
201 | return result; |
202 | } |
203 | |
204 | EncodedJSValue jsSVGNumberListNumberOfItems(ExecState* state, EncodedJSValue thisValue, PropertyName) |
205 | { |
206 | return IDLAttribute<JSSVGNumberList>::get<jsSVGNumberListNumberOfItemsGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "numberOfItems" ); |
207 | } |
208 | |
209 | static inline JSC::EncodedJSValue jsSVGNumberListPrototypeFunctionClearBody(JSC::ExecState* state, typename IDLOperation<JSSVGNumberList>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
210 | { |
211 | UNUSED_PARAM(state); |
212 | UNUSED_PARAM(throwScope); |
213 | auto& impl = castedThis->wrapped(); |
214 | propagateException(*state, throwScope, impl.clear()); |
215 | return JSValue::encode(jsUndefined()); |
216 | } |
217 | |
218 | EncodedJSValue JSC_HOST_CALL jsSVGNumberListPrototypeFunctionClear(ExecState* state) |
219 | { |
220 | return IDLOperation<JSSVGNumberList>::call<jsSVGNumberListPrototypeFunctionClearBody>(*state, "clear" ); |
221 | } |
222 | |
223 | static inline JSC::EncodedJSValue jsSVGNumberListPrototypeFunctionInitializeBody(JSC::ExecState* state, typename IDLOperation<JSSVGNumberList>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
224 | { |
225 | UNUSED_PARAM(state); |
226 | UNUSED_PARAM(throwScope); |
227 | auto& impl = castedThis->wrapped(); |
228 | if (UNLIKELY(state->argumentCount() < 1)) |
229 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
230 | auto item = convert<IDLInterface<SVGNumber>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "item" , "SVGNumberList" , "initialize" , "SVGNumber" ); }); |
231 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
232 | return JSValue::encode(toJS<IDLInterface<SVGNumber>>(*state, *castedThis->globalObject(), throwScope, impl.initialize(*item))); |
233 | } |
234 | |
235 | EncodedJSValue JSC_HOST_CALL jsSVGNumberListPrototypeFunctionInitialize(ExecState* state) |
236 | { |
237 | return IDLOperation<JSSVGNumberList>::call<jsSVGNumberListPrototypeFunctionInitializeBody>(*state, "initialize" ); |
238 | } |
239 | |
240 | static inline JSC::EncodedJSValue jsSVGNumberListPrototypeFunctionGetItemBody(JSC::ExecState* state, typename IDLOperation<JSSVGNumberList>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
241 | { |
242 | UNUSED_PARAM(state); |
243 | UNUSED_PARAM(throwScope); |
244 | auto& impl = castedThis->wrapped(); |
245 | if (UNLIKELY(state->argumentCount() < 1)) |
246 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
247 | auto index = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(0)); |
248 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
249 | return JSValue::encode(toJS<IDLInterface<SVGNumber>>(*state, *castedThis->globalObject(), throwScope, impl.getItem(WTFMove(index)))); |
250 | } |
251 | |
252 | EncodedJSValue JSC_HOST_CALL jsSVGNumberListPrototypeFunctionGetItem(ExecState* state) |
253 | { |
254 | return IDLOperation<JSSVGNumberList>::call<jsSVGNumberListPrototypeFunctionGetItemBody>(*state, "getItem" ); |
255 | } |
256 | |
257 | static inline JSC::EncodedJSValue jsSVGNumberListPrototypeFunctionInsertItemBeforeBody(JSC::ExecState* state, typename IDLOperation<JSSVGNumberList>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
258 | { |
259 | UNUSED_PARAM(state); |
260 | UNUSED_PARAM(throwScope); |
261 | auto& impl = castedThis->wrapped(); |
262 | if (UNLIKELY(state->argumentCount() < 2)) |
263 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
264 | auto item = convert<IDLInterface<SVGNumber>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "item" , "SVGNumberList" , "insertItemBefore" , "SVGNumber" ); }); |
265 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
266 | auto index = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(1)); |
267 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
268 | return JSValue::encode(toJS<IDLInterface<SVGNumber>>(*state, *castedThis->globalObject(), throwScope, impl.insertItemBefore(*item, WTFMove(index)))); |
269 | } |
270 | |
271 | EncodedJSValue JSC_HOST_CALL jsSVGNumberListPrototypeFunctionInsertItemBefore(ExecState* state) |
272 | { |
273 | return IDLOperation<JSSVGNumberList>::call<jsSVGNumberListPrototypeFunctionInsertItemBeforeBody>(*state, "insertItemBefore" ); |
274 | } |
275 | |
276 | static inline JSC::EncodedJSValue jsSVGNumberListPrototypeFunctionReplaceItemBody(JSC::ExecState* state, typename IDLOperation<JSSVGNumberList>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
277 | { |
278 | UNUSED_PARAM(state); |
279 | UNUSED_PARAM(throwScope); |
280 | auto& impl = castedThis->wrapped(); |
281 | if (UNLIKELY(state->argumentCount() < 2)) |
282 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
283 | auto item = convert<IDLInterface<SVGNumber>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "item" , "SVGNumberList" , "replaceItem" , "SVGNumber" ); }); |
284 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
285 | auto index = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(1)); |
286 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
287 | return JSValue::encode(toJS<IDLInterface<SVGNumber>>(*state, *castedThis->globalObject(), throwScope, impl.replaceItem(*item, WTFMove(index)))); |
288 | } |
289 | |
290 | EncodedJSValue JSC_HOST_CALL jsSVGNumberListPrototypeFunctionReplaceItem(ExecState* state) |
291 | { |
292 | return IDLOperation<JSSVGNumberList>::call<jsSVGNumberListPrototypeFunctionReplaceItemBody>(*state, "replaceItem" ); |
293 | } |
294 | |
295 | static inline JSC::EncodedJSValue jsSVGNumberListPrototypeFunctionRemoveItemBody(JSC::ExecState* state, typename IDLOperation<JSSVGNumberList>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
296 | { |
297 | UNUSED_PARAM(state); |
298 | UNUSED_PARAM(throwScope); |
299 | auto& impl = castedThis->wrapped(); |
300 | if (UNLIKELY(state->argumentCount() < 1)) |
301 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
302 | auto index = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(0)); |
303 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
304 | return JSValue::encode(toJS<IDLInterface<SVGNumber>>(*state, *castedThis->globalObject(), throwScope, impl.removeItem(WTFMove(index)))); |
305 | } |
306 | |
307 | EncodedJSValue JSC_HOST_CALL jsSVGNumberListPrototypeFunctionRemoveItem(ExecState* state) |
308 | { |
309 | return IDLOperation<JSSVGNumberList>::call<jsSVGNumberListPrototypeFunctionRemoveItemBody>(*state, "removeItem" ); |
310 | } |
311 | |
312 | static inline JSC::EncodedJSValue jsSVGNumberListPrototypeFunctionAppendItemBody(JSC::ExecState* state, typename IDLOperation<JSSVGNumberList>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
313 | { |
314 | UNUSED_PARAM(state); |
315 | UNUSED_PARAM(throwScope); |
316 | auto& impl = castedThis->wrapped(); |
317 | if (UNLIKELY(state->argumentCount() < 1)) |
318 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
319 | auto item = convert<IDLInterface<SVGNumber>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "item" , "SVGNumberList" , "appendItem" , "SVGNumber" ); }); |
320 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
321 | return JSValue::encode(toJS<IDLInterface<SVGNumber>>(*state, *castedThis->globalObject(), throwScope, impl.appendItem(*item))); |
322 | } |
323 | |
324 | EncodedJSValue JSC_HOST_CALL jsSVGNumberListPrototypeFunctionAppendItem(ExecState* state) |
325 | { |
326 | return IDLOperation<JSSVGNumberList>::call<jsSVGNumberListPrototypeFunctionAppendItemBody>(*state, "appendItem" ); |
327 | } |
328 | |
329 | void JSSVGNumberList::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
330 | { |
331 | auto* thisObject = jsCast<JSSVGNumberList*>(cell); |
332 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
333 | if (thisObject->scriptExecutionContext()) |
334 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
335 | Base::heapSnapshot(cell, builder); |
336 | } |
337 | |
338 | bool JSSVGNumberListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) |
339 | { |
340 | UNUSED_PARAM(handle); |
341 | UNUSED_PARAM(visitor); |
342 | UNUSED_PARAM(reason); |
343 | return false; |
344 | } |
345 | |
346 | void JSSVGNumberListOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
347 | { |
348 | auto* jsSVGNumberList = static_cast<JSSVGNumberList*>(handle.slot()->asCell()); |
349 | auto& world = *static_cast<DOMWrapperWorld*>(context); |
350 | uncacheWrapper(world, &jsSVGNumberList->wrapped(), jsSVGNumberList); |
351 | } |
352 | |
353 | #if ENABLE(BINDING_INTEGRITY) |
354 | #if PLATFORM(WIN) |
355 | #pragma warning(disable: 4483) |
356 | extern "C" { extern void (*const __identifier("??_7SVGNumberList@WebCore@@6B@" )[])(); } |
357 | #else |
358 | extern "C" { extern void* _ZTVN7WebCore13SVGNumberListE[]; } |
359 | #endif |
360 | #endif |
361 | |
362 | JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<SVGNumberList>&& impl) |
363 | { |
364 | |
365 | #if ENABLE(BINDING_INTEGRITY) |
366 | void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr())); |
367 | #if PLATFORM(WIN) |
368 | void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(__identifier("??_7SVGNumberList@WebCore@@6B@" )); |
369 | #else |
370 | void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(&_ZTVN7WebCore13SVGNumberListE[2]); |
371 | #endif |
372 | |
373 | // If this fails SVGNumberList does not have a vtable, so you need to add the |
374 | // ImplementationLacksVTable attribute to the interface definition |
375 | static_assert(std::is_polymorphic<SVGNumberList>::value, "SVGNumberList is not polymorphic" ); |
376 | |
377 | // If you hit this assertion you either have a use after free bug, or |
378 | // SVGNumberList has subclasses. If SVGNumberList has subclasses that get passed |
379 | // to toJS() we currently require SVGNumberList you to opt out of binding hardening |
380 | // by adding the SkipVTableValidation attribute to the interface IDL definition |
381 | RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); |
382 | #endif |
383 | return createWrapper<SVGNumberList>(globalObject, WTFMove(impl)); |
384 | } |
385 | |
386 | JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, SVGNumberList& impl) |
387 | { |
388 | return wrap(state, globalObject, impl); |
389 | } |
390 | |
391 | SVGNumberList* JSSVGNumberList::toWrapped(JSC::VM& vm, JSC::JSValue value) |
392 | { |
393 | if (auto* wrapper = jsDynamicCast<JSSVGNumberList*>(vm, value)) |
394 | return &wrapper->wrapped(); |
395 | return nullptr; |
396 | } |
397 | |
398 | } |
399 | |