Web Inspector: Implement `queryHolders` Command Line API
[WebKit-https.git] / Source / WebCore / bindings / scripts / test / JS / JSTestSerializedScriptValueInterface.cpp
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
23 #if ENABLE(Condition1) || ENABLE(Condition2)
24
25 #include "JSTestSerializedScriptValueInterface.h"
26
27 #include "JSDOMAttribute.h"
28 #include "JSDOMBinding.h"
29 #include "JSDOMConstructorNotConstructable.h"
30 #include "JSDOMConvertInterface.h"
31 #include "JSDOMConvertSequences.h"
32 #include "JSDOMConvertSerializedScriptValue.h"
33 #include "JSDOMExceptionHandling.h"
34 #include "JSDOMGlobalObject.h"
35 #include "JSDOMOperation.h"
36 #include "JSDOMWrapperCache.h"
37 #include "JSMessagePort.h"
38 #include "ScriptExecutionContext.h"
39 #include "SerializedScriptValue.h"
40 #include <JavaScriptCore/FunctionPrototype.h>
41 #include <JavaScriptCore/HeapAnalyzer.h>
42 #include <JavaScriptCore/JSArray.h>
43 #include <JavaScriptCore/JSCInlines.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 jsTestSerializedScriptValueInterfacePrototypeFunctionFunction(JSC::ExecState*);
55 JSC::EncodedJSValue JSC_HOST_CALL jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionReturning(JSC::ExecState*);
56
57 // Attributes
58
59 JSC::EncodedJSValue jsTestSerializedScriptValueInterfaceConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
60 bool setJSTestSerializedScriptValueInterfaceConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
61 JSC::EncodedJSValue jsTestSerializedScriptValueInterfaceValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
62 bool setJSTestSerializedScriptValueInterfaceValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
63 JSC::EncodedJSValue jsTestSerializedScriptValueInterfaceReadonlyValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
64 JSC::EncodedJSValue jsTestSerializedScriptValueInterfaceCachedValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
65 bool setJSTestSerializedScriptValueInterfaceCachedValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
66 JSC::EncodedJSValue jsTestSerializedScriptValueInterfacePorts(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
67 JSC::EncodedJSValue jsTestSerializedScriptValueInterfaceCachedReadonlyValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
68
69 class JSTestSerializedScriptValueInterfacePrototype : public JSC::JSNonFinalObject {
70 public:
71     using Base = JSC::JSNonFinalObject;
72     static JSTestSerializedScriptValueInterfacePrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
73     {
74         JSTestSerializedScriptValueInterfacePrototype* ptr = new (NotNull, JSC::allocateCell<JSTestSerializedScriptValueInterfacePrototype>(vm.heap)) JSTestSerializedScriptValueInterfacePrototype(vm, globalObject, structure);
75         ptr->finishCreation(vm);
76         return ptr;
77     }
78
79     DECLARE_INFO;
80     static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
81     {
82         return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
83     }
84
85 private:
86     JSTestSerializedScriptValueInterfacePrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
87         : JSC::JSNonFinalObject(vm, structure)
88     {
89     }
90
91     void finishCreation(JSC::VM&);
92 };
93
94 using JSTestSerializedScriptValueInterfaceConstructor = JSDOMConstructorNotConstructable<JSTestSerializedScriptValueInterface>;
95
96 template<> JSValue JSTestSerializedScriptValueInterfaceConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
97 {
98     UNUSED_PARAM(vm);
99     return globalObject.functionPrototype();
100 }
101
102 template<> void JSTestSerializedScriptValueInterfaceConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
103 {
104     putDirect(vm, vm.propertyNames->prototype, JSTestSerializedScriptValueInterface::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
105     putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("TestSerializedScriptValueInterface"_s)), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
106     putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
107 }
108
109 template<> const ClassInfo JSTestSerializedScriptValueInterfaceConstructor::s_info = { "TestSerializedScriptValueInterface", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestSerializedScriptValueInterfaceConstructor) };
110
111 /* Hash table for prototype */
112
113 static const HashTableValue JSTestSerializedScriptValueInterfacePrototypeTableValues[] =
114 {
115     { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfaceConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializedScriptValueInterfaceConstructor) } },
116     { "value", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfaceValue), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializedScriptValueInterfaceValue) } },
117     { "readonlyValue", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfaceReadonlyValue), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
118     { "cachedValue", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfaceCachedValue), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializedScriptValueInterfaceCachedValue) } },
119     { "ports", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfacePorts), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
120     { "cachedReadonlyValue", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfaceCachedReadonlyValue), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
121     { "function", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestSerializedScriptValueInterfacePrototypeFunctionFunction), (intptr_t) (1) } },
122     { "functionReturning", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionReturning), (intptr_t) (0) } },
123 };
124
125 const ClassInfo JSTestSerializedScriptValueInterfacePrototype::s_info = { "TestSerializedScriptValueInterfacePrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestSerializedScriptValueInterfacePrototype) };
126
127 void JSTestSerializedScriptValueInterfacePrototype::finishCreation(VM& vm)
128 {
129     Base::finishCreation(vm);
130     reifyStaticProperties(vm, JSTestSerializedScriptValueInterface::info(), JSTestSerializedScriptValueInterfacePrototypeTableValues, *this);
131 }
132
133 const ClassInfo JSTestSerializedScriptValueInterface::s_info = { "TestSerializedScriptValueInterface", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestSerializedScriptValueInterface) };
134
135 JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestSerializedScriptValueInterface>&& impl)
136     : JSDOMWrapper<TestSerializedScriptValueInterface>(structure, globalObject, WTFMove(impl))
137 {
138 }
139
140 void JSTestSerializedScriptValueInterface::finishCreation(VM& vm)
141 {
142     Base::finishCreation(vm);
143     ASSERT(inherits(vm, info()));
144
145 }
146
147 JSObject* JSTestSerializedScriptValueInterface::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
148 {
149     return JSTestSerializedScriptValueInterfacePrototype::create(vm, &globalObject, JSTestSerializedScriptValueInterfacePrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
150 }
151
152 JSObject* JSTestSerializedScriptValueInterface::prototype(VM& vm, JSDOMGlobalObject& globalObject)
153 {
154     return getDOMPrototype<JSTestSerializedScriptValueInterface>(vm, globalObject);
155 }
156
157 JSValue JSTestSerializedScriptValueInterface::getConstructor(VM& vm, const JSGlobalObject* globalObject)
158 {
159     return getDOMConstructor<JSTestSerializedScriptValueInterfaceConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
160 }
161
162 void JSTestSerializedScriptValueInterface::destroy(JSC::JSCell* cell)
163 {
164     JSTestSerializedScriptValueInterface* thisObject = static_cast<JSTestSerializedScriptValueInterface*>(cell);
165     thisObject->JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface();
166 }
167
168 template<> inline JSTestSerializedScriptValueInterface* IDLAttribute<JSTestSerializedScriptValueInterface>::cast(ExecState& state, EncodedJSValue thisValue)
169 {
170     return jsDynamicCast<JSTestSerializedScriptValueInterface*>(state.vm(), JSValue::decode(thisValue));
171 }
172
173 template<> inline JSTestSerializedScriptValueInterface* IDLOperation<JSTestSerializedScriptValueInterface>::cast(ExecState& state)
174 {
175     return jsDynamicCast<JSTestSerializedScriptValueInterface*>(state.vm(), state.thisValue());
176 }
177
178 EncodedJSValue jsTestSerializedScriptValueInterfaceConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
179 {
180     VM& vm = state->vm();
181     auto throwScope = DECLARE_THROW_SCOPE(vm);
182     auto* prototype = jsDynamicCast<JSTestSerializedScriptValueInterfacePrototype*>(vm, JSValue::decode(thisValue));
183     if (UNLIKELY(!prototype))
184         return throwVMTypeError(state, throwScope);
185     return JSValue::encode(JSTestSerializedScriptValueInterface::getConstructor(state->vm(), prototype->globalObject()));
186 }
187
188 bool setJSTestSerializedScriptValueInterfaceConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
189 {
190     VM& vm = state->vm();
191     auto throwScope = DECLARE_THROW_SCOPE(vm);
192     auto* prototype = jsDynamicCast<JSTestSerializedScriptValueInterfacePrototype*>(vm, JSValue::decode(thisValue));
193     if (UNLIKELY(!prototype)) {
194         throwVMTypeError(state, throwScope);
195         return false;
196     }
197     // Shadowing a built-in constructor
198     return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue));
199 }
200
201 static inline JSValue jsTestSerializedScriptValueInterfaceValueGetter(ExecState& state, JSTestSerializedScriptValueInterface& thisObject, ThrowScope& throwScope)
202 {
203     UNUSED_PARAM(throwScope);
204     UNUSED_PARAM(state);
205     auto& impl = thisObject.wrapped();
206     JSValue result = toJS<IDLSerializedScriptValue<SerializedScriptValue>>(state, *thisObject.globalObject(), throwScope, impl.value());
207     return result;
208 }
209
210 EncodedJSValue jsTestSerializedScriptValueInterfaceValue(ExecState* state, EncodedJSValue thisValue, PropertyName)
211 {
212     return IDLAttribute<JSTestSerializedScriptValueInterface>::get<jsTestSerializedScriptValueInterfaceValueGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "value");
213 }
214
215 static inline bool setJSTestSerializedScriptValueInterfaceValueSetter(ExecState& state, JSTestSerializedScriptValueInterface& thisObject, JSValue value, ThrowScope& throwScope)
216 {
217     UNUSED_PARAM(throwScope);
218     auto& impl = thisObject.wrapped();
219     auto nativeValue = convert<IDLSerializedScriptValue<SerializedScriptValue>>(state, value);
220     RETURN_IF_EXCEPTION(throwScope, false);
221     AttributeSetter::call(state, throwScope, [&] {
222         return impl.setValue(WTFMove(nativeValue));
223     });
224     return true;
225 }
226
227 bool setJSTestSerializedScriptValueInterfaceValue(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
228 {
229     return IDLAttribute<JSTestSerializedScriptValueInterface>::set<setJSTestSerializedScriptValueInterfaceValueSetter>(*state, thisValue, encodedValue, "value");
230 }
231
232 static inline JSValue jsTestSerializedScriptValueInterfaceReadonlyValueGetter(ExecState& state, JSTestSerializedScriptValueInterface& thisObject, ThrowScope& throwScope)
233 {
234     UNUSED_PARAM(throwScope);
235     UNUSED_PARAM(state);
236     auto& impl = thisObject.wrapped();
237     JSValue result = toJS<IDLSerializedScriptValue<SerializedScriptValue>>(state, *thisObject.globalObject(), throwScope, impl.readonlyValue());
238     return result;
239 }
240
241 EncodedJSValue jsTestSerializedScriptValueInterfaceReadonlyValue(ExecState* state, EncodedJSValue thisValue, PropertyName)
242 {
243     return IDLAttribute<JSTestSerializedScriptValueInterface>::get<jsTestSerializedScriptValueInterfaceReadonlyValueGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "readonlyValue");
244 }
245
246 static inline JSValue jsTestSerializedScriptValueInterfaceCachedValueGetter(ExecState& state, JSTestSerializedScriptValueInterface& thisObject, ThrowScope& throwScope)
247 {
248     UNUSED_PARAM(throwScope);
249     UNUSED_PARAM(state);
250     if (JSValue cachedValue = thisObject.m_cachedValue.get())
251         return cachedValue;
252     auto& impl = thisObject.wrapped();
253     JSValue result = toJS<IDLSerializedScriptValue<SerializedScriptValue>>(state, *thisObject.globalObject(), throwScope, impl.cachedValue());
254     thisObject.m_cachedValue.set(state.vm(), &thisObject, result);
255     return result;
256 }
257
258 EncodedJSValue jsTestSerializedScriptValueInterfaceCachedValue(ExecState* state, EncodedJSValue thisValue, PropertyName)
259 {
260     return IDLAttribute<JSTestSerializedScriptValueInterface>::get<jsTestSerializedScriptValueInterfaceCachedValueGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "cachedValue");
261 }
262
263 static inline bool setJSTestSerializedScriptValueInterfaceCachedValueSetter(ExecState& state, JSTestSerializedScriptValueInterface& thisObject, JSValue value, ThrowScope& throwScope)
264 {
265     UNUSED_PARAM(throwScope);
266     auto& impl = thisObject.wrapped();
267     auto nativeValue = convert<IDLSerializedScriptValue<SerializedScriptValue>>(state, value);
268     RETURN_IF_EXCEPTION(throwScope, false);
269     AttributeSetter::call(state, throwScope, [&] {
270         return impl.setCachedValue(WTFMove(nativeValue));
271     });
272     return true;
273 }
274
275 bool setJSTestSerializedScriptValueInterfaceCachedValue(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
276 {
277     return IDLAttribute<JSTestSerializedScriptValueInterface>::set<setJSTestSerializedScriptValueInterfaceCachedValueSetter>(*state, thisValue, encodedValue, "cachedValue");
278 }
279
280 static inline JSValue jsTestSerializedScriptValueInterfacePortsGetter(ExecState& state, JSTestSerializedScriptValueInterface& thisObject, ThrowScope& throwScope)
281 {
282     UNUSED_PARAM(throwScope);
283     UNUSED_PARAM(state);
284     auto& impl = thisObject.wrapped();
285     JSValue result = toJS<IDLSequence<IDLInterface<MessagePort>>>(state, *thisObject.globalObject(), throwScope, impl.ports());
286     return result;
287 }
288
289 EncodedJSValue jsTestSerializedScriptValueInterfacePorts(ExecState* state, EncodedJSValue thisValue, PropertyName)
290 {
291     return IDLAttribute<JSTestSerializedScriptValueInterface>::get<jsTestSerializedScriptValueInterfacePortsGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "ports");
292 }
293
294 static inline JSValue jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter(ExecState& state, JSTestSerializedScriptValueInterface& thisObject, ThrowScope& throwScope)
295 {
296     UNUSED_PARAM(throwScope);
297     UNUSED_PARAM(state);
298     if (JSValue cachedValue = thisObject.m_cachedReadonlyValue.get())
299         return cachedValue;
300     auto& impl = thisObject.wrapped();
301     JSValue result = toJS<IDLSerializedScriptValue<SerializedScriptValue>>(state, *thisObject.globalObject(), throwScope, impl.cachedReadonlyValue());
302     thisObject.m_cachedReadonlyValue.set(state.vm(), &thisObject, result);
303     return result;
304 }
305
306 EncodedJSValue jsTestSerializedScriptValueInterfaceCachedReadonlyValue(ExecState* state, EncodedJSValue thisValue, PropertyName)
307 {
308     return IDLAttribute<JSTestSerializedScriptValueInterface>::get<jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "cachedReadonlyValue");
309 }
310
311 static inline JSC::EncodedJSValue jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionBody(JSC::ExecState* state, typename IDLOperation<JSTestSerializedScriptValueInterface>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
312 {
313     UNUSED_PARAM(state);
314     UNUSED_PARAM(throwScope);
315     auto& impl = castedThis->wrapped();
316     if (UNLIKELY(state->argumentCount() < 1))
317         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
318     auto value = convert<IDLSerializedScriptValue<SerializedScriptValue>>(*state, state->uncheckedArgument(0));
319     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
320     impl.function(WTFMove(value));
321     return JSValue::encode(jsUndefined());
322 }
323
324 EncodedJSValue JSC_HOST_CALL jsTestSerializedScriptValueInterfacePrototypeFunctionFunction(ExecState* state)
325 {
326     return IDLOperation<JSTestSerializedScriptValueInterface>::call<jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionBody>(*state, "function");
327 }
328
329 static inline JSC::EncodedJSValue jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionReturningBody(JSC::ExecState* state, typename IDLOperation<JSTestSerializedScriptValueInterface>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
330 {
331     UNUSED_PARAM(state);
332     UNUSED_PARAM(throwScope);
333     auto& impl = castedThis->wrapped();
334     return JSValue::encode(toJS<IDLSerializedScriptValue<SerializedScriptValue>>(*state, *castedThis->globalObject(), impl.functionReturning()));
335 }
336
337 EncodedJSValue JSC_HOST_CALL jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionReturning(ExecState* state)
338 {
339     return IDLOperation<JSTestSerializedScriptValueInterface>::call<jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionReturningBody>(*state, "functionReturning");
340 }
341
342 void JSTestSerializedScriptValueInterface::visitChildren(JSCell* cell, SlotVisitor& visitor)
343 {
344     auto* thisObject = jsCast<JSTestSerializedScriptValueInterface*>(cell);
345     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
346     Base::visitChildren(thisObject, visitor);
347     visitor.append(thisObject->m_cachedValue);
348     visitor.append(thisObject->m_cachedReadonlyValue);
349 }
350
351 void JSTestSerializedScriptValueInterface::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer)
352 {
353     auto* thisObject = jsCast<JSTestSerializedScriptValueInterface*>(cell);
354     analyzer.setWrappedObjectForCell(cell, &thisObject->wrapped());
355     if (thisObject->scriptExecutionContext())
356         analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
357     Base::analyzeHeap(cell, analyzer);
358 }
359
360 bool JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason)
361 {
362     UNUSED_PARAM(handle);
363     UNUSED_PARAM(visitor);
364     UNUSED_PARAM(reason);
365     return false;
366 }
367
368 void JSTestSerializedScriptValueInterfaceOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
369 {
370     auto* jsTestSerializedScriptValueInterface = static_cast<JSTestSerializedScriptValueInterface*>(handle.slot()->asCell());
371     auto& world = *static_cast<DOMWrapperWorld*>(context);
372     uncacheWrapper(world, &jsTestSerializedScriptValueInterface->wrapped(), jsTestSerializedScriptValueInterface);
373 }
374
375 #if ENABLE(BINDING_INTEGRITY)
376 #if PLATFORM(WIN)
377 #pragma warning(disable: 4483)
378 extern "C" { extern void (*const __identifier("??_7TestSerializedScriptValueInterface@WebCore@@6B@")[])(); }
379 #else
380 extern "C" { extern void* _ZTVN7WebCore34TestSerializedScriptValueInterfaceE[]; }
381 #endif
382 #endif
383
384 JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestSerializedScriptValueInterface>&& impl)
385 {
386
387 #if ENABLE(BINDING_INTEGRITY)
388     void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
389 #if PLATFORM(WIN)
390     void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(__identifier("??_7TestSerializedScriptValueInterface@WebCore@@6B@"));
391 #else
392     void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(&_ZTVN7WebCore34TestSerializedScriptValueInterfaceE[2]);
393 #endif
394
395     // If this fails TestSerializedScriptValueInterface does not have a vtable, so you need to add the
396     // ImplementationLacksVTable attribute to the interface definition
397     static_assert(std::is_polymorphic<TestSerializedScriptValueInterface>::value, "TestSerializedScriptValueInterface is not polymorphic");
398
399     // If you hit this assertion you either have a use after free bug, or
400     // TestSerializedScriptValueInterface has subclasses. If TestSerializedScriptValueInterface has subclasses that get passed
401     // to toJS() we currently require TestSerializedScriptValueInterface you to opt out of binding hardening
402     // by adding the SkipVTableValidation attribute to the interface IDL definition
403     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
404 #endif
405     return createWrapper<TestSerializedScriptValueInterface>(globalObject, WTFMove(impl));
406 }
407
408 JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestSerializedScriptValueInterface& impl)
409 {
410     return wrap(state, globalObject, impl);
411 }
412
413 TestSerializedScriptValueInterface* JSTestSerializedScriptValueInterface::toWrapped(JSC::VM& vm, JSC::JSValue value)
414 {
415     if (auto* wrapper = jsDynamicCast<JSTestSerializedScriptValueInterface*>(vm, value))
416         return &wrapper->wrapped();
417     return nullptr;
418 }
419
420 }
421
422 #endif // ENABLE(Condition1) || ENABLE(Condition2)