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 "JSWorkerLocation.h" |
23 | |
24 | #include "JSDOMAttribute.h" |
25 | #include "JSDOMBinding.h" |
26 | #include "JSDOMConstructorNotConstructable.h" |
27 | #include "JSDOMConvertStrings.h" |
28 | #include "JSDOMExceptionHandling.h" |
29 | #include "JSDOMOperation.h" |
30 | #include "JSDOMWrapperCache.h" |
31 | #include "ScriptExecutionContext.h" |
32 | #include <JavaScriptCore/FunctionPrototype.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 | |
40 | namespace WebCore { |
41 | using namespace JSC; |
42 | |
43 | // Functions |
44 | |
45 | JSC::EncodedJSValue JSC_HOST_CALL jsWorkerLocationPrototypeFunctionToString(JSC::ExecState*); |
46 | |
47 | // Attributes |
48 | |
49 | JSC::EncodedJSValue jsWorkerLocationConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
50 | bool setJSWorkerLocationConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
51 | JSC::EncodedJSValue jsWorkerLocationHref(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
52 | JSC::EncodedJSValue jsWorkerLocationProtocol(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
53 | JSC::EncodedJSValue jsWorkerLocationHost(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
54 | JSC::EncodedJSValue jsWorkerLocationHostname(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
55 | JSC::EncodedJSValue jsWorkerLocationPort(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
56 | JSC::EncodedJSValue jsWorkerLocationPathname(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
57 | JSC::EncodedJSValue jsWorkerLocationSearch(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
58 | JSC::EncodedJSValue jsWorkerLocationHash(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
59 | JSC::EncodedJSValue jsWorkerLocationOrigin(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
60 | |
61 | class JSWorkerLocationPrototype : public JSC::JSNonFinalObject { |
62 | public: |
63 | using Base = JSC::JSNonFinalObject; |
64 | static JSWorkerLocationPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
65 | { |
66 | JSWorkerLocationPrototype* ptr = new (NotNull, JSC::allocateCell<JSWorkerLocationPrototype>(vm.heap)) JSWorkerLocationPrototype(vm, globalObject, structure); |
67 | ptr->finishCreation(vm); |
68 | return ptr; |
69 | } |
70 | |
71 | DECLARE_INFO; |
72 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
73 | { |
74 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
75 | } |
76 | |
77 | private: |
78 | JSWorkerLocationPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
79 | : JSC::JSNonFinalObject(vm, structure) |
80 | { |
81 | } |
82 | |
83 | void finishCreation(JSC::VM&); |
84 | }; |
85 | |
86 | using JSWorkerLocationConstructor = JSDOMConstructorNotConstructable<JSWorkerLocation>; |
87 | |
88 | template<> JSValue JSWorkerLocationConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
89 | { |
90 | UNUSED_PARAM(vm); |
91 | return globalObject.functionPrototype(); |
92 | } |
93 | |
94 | template<> void JSWorkerLocationConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
95 | { |
96 | putDirect(vm, vm.propertyNames->prototype, JSWorkerLocation::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
97 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("WorkerLocation"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
98 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
99 | } |
100 | |
101 | template<> const ClassInfo JSWorkerLocationConstructor::s_info = { "WorkerLocation" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSWorkerLocationConstructor) }; |
102 | |
103 | /* Hash table for prototype */ |
104 | |
105 | static const HashTableValue JSWorkerLocationPrototypeTableValues[] = |
106 | { |
107 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerLocationConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerLocationConstructor) } }, |
108 | { "href" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerLocationHref), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
109 | { "protocol" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerLocationProtocol), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
110 | { "host" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerLocationHost), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
111 | { "hostname" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerLocationHostname), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
112 | { "port" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerLocationPort), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
113 | { "pathname" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerLocationPathname), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
114 | { "search" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerLocationSearch), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
115 | { "hash" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerLocationHash), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
116 | { "origin" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerLocationOrigin), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
117 | { "toString" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsWorkerLocationPrototypeFunctionToString), (intptr_t) (0) } }, |
118 | }; |
119 | |
120 | const ClassInfo JSWorkerLocationPrototype::s_info = { "WorkerLocationPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSWorkerLocationPrototype) }; |
121 | |
122 | void JSWorkerLocationPrototype::finishCreation(VM& vm) |
123 | { |
124 | Base::finishCreation(vm); |
125 | reifyStaticProperties(vm, JSWorkerLocation::info(), JSWorkerLocationPrototypeTableValues, *this); |
126 | } |
127 | |
128 | const ClassInfo JSWorkerLocation::s_info = { "WorkerLocation" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSWorkerLocation) }; |
129 | |
130 | JSWorkerLocation::JSWorkerLocation(Structure* structure, JSDOMGlobalObject& globalObject, Ref<WorkerLocation>&& impl) |
131 | : JSDOMWrapper<WorkerLocation>(structure, globalObject, WTFMove(impl)) |
132 | { |
133 | } |
134 | |
135 | void JSWorkerLocation::finishCreation(VM& vm) |
136 | { |
137 | Base::finishCreation(vm); |
138 | ASSERT(inherits(vm, info())); |
139 | |
140 | } |
141 | |
142 | JSObject* JSWorkerLocation::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
143 | { |
144 | return JSWorkerLocationPrototype::create(vm, &globalObject, JSWorkerLocationPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); |
145 | } |
146 | |
147 | JSObject* JSWorkerLocation::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
148 | { |
149 | return getDOMPrototype<JSWorkerLocation>(vm, globalObject); |
150 | } |
151 | |
152 | JSValue JSWorkerLocation::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
153 | { |
154 | return getDOMConstructor<JSWorkerLocationConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
155 | } |
156 | |
157 | void JSWorkerLocation::destroy(JSC::JSCell* cell) |
158 | { |
159 | JSWorkerLocation* thisObject = static_cast<JSWorkerLocation*>(cell); |
160 | thisObject->JSWorkerLocation::~JSWorkerLocation(); |
161 | } |
162 | |
163 | template<> inline JSWorkerLocation* IDLAttribute<JSWorkerLocation>::cast(ExecState& state, EncodedJSValue thisValue) |
164 | { |
165 | return jsDynamicCast<JSWorkerLocation*>(state.vm(), JSValue::decode(thisValue)); |
166 | } |
167 | |
168 | template<> inline JSWorkerLocation* IDLOperation<JSWorkerLocation>::cast(ExecState& state) |
169 | { |
170 | return jsDynamicCast<JSWorkerLocation*>(state.vm(), state.thisValue()); |
171 | } |
172 | |
173 | EncodedJSValue jsWorkerLocationConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
174 | { |
175 | VM& vm = state->vm(); |
176 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
177 | auto* prototype = jsDynamicCast<JSWorkerLocationPrototype*>(vm, JSValue::decode(thisValue)); |
178 | if (UNLIKELY(!prototype)) |
179 | return throwVMTypeError(state, throwScope); |
180 | return JSValue::encode(JSWorkerLocation::getConstructor(state->vm(), prototype->globalObject())); |
181 | } |
182 | |
183 | bool setJSWorkerLocationConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
184 | { |
185 | VM& vm = state->vm(); |
186 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
187 | auto* prototype = jsDynamicCast<JSWorkerLocationPrototype*>(vm, JSValue::decode(thisValue)); |
188 | if (UNLIKELY(!prototype)) { |
189 | throwVMTypeError(state, throwScope); |
190 | return false; |
191 | } |
192 | // Shadowing a built-in constructor |
193 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
194 | } |
195 | |
196 | static inline JSValue jsWorkerLocationHrefGetter(ExecState& state, JSWorkerLocation& thisObject, ThrowScope& throwScope) |
197 | { |
198 | UNUSED_PARAM(throwScope); |
199 | UNUSED_PARAM(state); |
200 | auto& impl = thisObject.wrapped(); |
201 | JSValue result = toJS<IDLUSVString>(state, throwScope, impl.href()); |
202 | return result; |
203 | } |
204 | |
205 | EncodedJSValue jsWorkerLocationHref(ExecState* state, EncodedJSValue thisValue, PropertyName) |
206 | { |
207 | return IDLAttribute<JSWorkerLocation>::get<jsWorkerLocationHrefGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "href" ); |
208 | } |
209 | |
210 | static inline JSValue jsWorkerLocationProtocolGetter(ExecState& state, JSWorkerLocation& thisObject, ThrowScope& throwScope) |
211 | { |
212 | UNUSED_PARAM(throwScope); |
213 | UNUSED_PARAM(state); |
214 | auto& impl = thisObject.wrapped(); |
215 | JSValue result = toJS<IDLUSVString>(state, throwScope, impl.protocol()); |
216 | return result; |
217 | } |
218 | |
219 | EncodedJSValue jsWorkerLocationProtocol(ExecState* state, EncodedJSValue thisValue, PropertyName) |
220 | { |
221 | return IDLAttribute<JSWorkerLocation>::get<jsWorkerLocationProtocolGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "protocol" ); |
222 | } |
223 | |
224 | static inline JSValue jsWorkerLocationHostGetter(ExecState& state, JSWorkerLocation& thisObject, ThrowScope& throwScope) |
225 | { |
226 | UNUSED_PARAM(throwScope); |
227 | UNUSED_PARAM(state); |
228 | auto& impl = thisObject.wrapped(); |
229 | JSValue result = toJS<IDLUSVString>(state, throwScope, impl.host()); |
230 | return result; |
231 | } |
232 | |
233 | EncodedJSValue jsWorkerLocationHost(ExecState* state, EncodedJSValue thisValue, PropertyName) |
234 | { |
235 | return IDLAttribute<JSWorkerLocation>::get<jsWorkerLocationHostGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "host" ); |
236 | } |
237 | |
238 | static inline JSValue jsWorkerLocationHostnameGetter(ExecState& state, JSWorkerLocation& thisObject, ThrowScope& throwScope) |
239 | { |
240 | UNUSED_PARAM(throwScope); |
241 | UNUSED_PARAM(state); |
242 | auto& impl = thisObject.wrapped(); |
243 | JSValue result = toJS<IDLUSVString>(state, throwScope, impl.hostname()); |
244 | return result; |
245 | } |
246 | |
247 | EncodedJSValue jsWorkerLocationHostname(ExecState* state, EncodedJSValue thisValue, PropertyName) |
248 | { |
249 | return IDLAttribute<JSWorkerLocation>::get<jsWorkerLocationHostnameGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "hostname" ); |
250 | } |
251 | |
252 | static inline JSValue jsWorkerLocationPortGetter(ExecState& state, JSWorkerLocation& thisObject, ThrowScope& throwScope) |
253 | { |
254 | UNUSED_PARAM(throwScope); |
255 | UNUSED_PARAM(state); |
256 | auto& impl = thisObject.wrapped(); |
257 | JSValue result = toJS<IDLUSVString>(state, throwScope, impl.port()); |
258 | return result; |
259 | } |
260 | |
261 | EncodedJSValue jsWorkerLocationPort(ExecState* state, EncodedJSValue thisValue, PropertyName) |
262 | { |
263 | return IDLAttribute<JSWorkerLocation>::get<jsWorkerLocationPortGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "port" ); |
264 | } |
265 | |
266 | static inline JSValue jsWorkerLocationPathnameGetter(ExecState& state, JSWorkerLocation& thisObject, ThrowScope& throwScope) |
267 | { |
268 | UNUSED_PARAM(throwScope); |
269 | UNUSED_PARAM(state); |
270 | auto& impl = thisObject.wrapped(); |
271 | JSValue result = toJS<IDLUSVString>(state, throwScope, impl.pathname()); |
272 | return result; |
273 | } |
274 | |
275 | EncodedJSValue jsWorkerLocationPathname(ExecState* state, EncodedJSValue thisValue, PropertyName) |
276 | { |
277 | return IDLAttribute<JSWorkerLocation>::get<jsWorkerLocationPathnameGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "pathname" ); |
278 | } |
279 | |
280 | static inline JSValue jsWorkerLocationSearchGetter(ExecState& state, JSWorkerLocation& thisObject, ThrowScope& throwScope) |
281 | { |
282 | UNUSED_PARAM(throwScope); |
283 | UNUSED_PARAM(state); |
284 | auto& impl = thisObject.wrapped(); |
285 | JSValue result = toJS<IDLUSVString>(state, throwScope, impl.search()); |
286 | return result; |
287 | } |
288 | |
289 | EncodedJSValue jsWorkerLocationSearch(ExecState* state, EncodedJSValue thisValue, PropertyName) |
290 | { |
291 | return IDLAttribute<JSWorkerLocation>::get<jsWorkerLocationSearchGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "search" ); |
292 | } |
293 | |
294 | static inline JSValue jsWorkerLocationHashGetter(ExecState& state, JSWorkerLocation& thisObject, ThrowScope& throwScope) |
295 | { |
296 | UNUSED_PARAM(throwScope); |
297 | UNUSED_PARAM(state); |
298 | auto& impl = thisObject.wrapped(); |
299 | JSValue result = toJS<IDLUSVString>(state, throwScope, impl.hash()); |
300 | return result; |
301 | } |
302 | |
303 | EncodedJSValue jsWorkerLocationHash(ExecState* state, EncodedJSValue thisValue, PropertyName) |
304 | { |
305 | return IDLAttribute<JSWorkerLocation>::get<jsWorkerLocationHashGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "hash" ); |
306 | } |
307 | |
308 | static inline JSValue jsWorkerLocationOriginGetter(ExecState& state, JSWorkerLocation& thisObject, ThrowScope& throwScope) |
309 | { |
310 | UNUSED_PARAM(throwScope); |
311 | UNUSED_PARAM(state); |
312 | auto& impl = thisObject.wrapped(); |
313 | JSValue result = toJS<IDLUSVString>(state, throwScope, impl.origin()); |
314 | return result; |
315 | } |
316 | |
317 | EncodedJSValue jsWorkerLocationOrigin(ExecState* state, EncodedJSValue thisValue, PropertyName) |
318 | { |
319 | return IDLAttribute<JSWorkerLocation>::get<jsWorkerLocationOriginGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "origin" ); |
320 | } |
321 | |
322 | static inline JSC::EncodedJSValue jsWorkerLocationPrototypeFunctionToStringBody(JSC::ExecState* state, typename IDLOperation<JSWorkerLocation>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
323 | { |
324 | UNUSED_PARAM(state); |
325 | UNUSED_PARAM(throwScope); |
326 | auto& impl = castedThis->wrapped(); |
327 | return JSValue::encode(toJS<IDLUSVString>(*state, impl.href())); |
328 | } |
329 | |
330 | EncodedJSValue JSC_HOST_CALL jsWorkerLocationPrototypeFunctionToString(ExecState* state) |
331 | { |
332 | return IDLOperation<JSWorkerLocation>::call<jsWorkerLocationPrototypeFunctionToStringBody>(*state, "toString" ); |
333 | } |
334 | |
335 | void JSWorkerLocation::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
336 | { |
337 | auto* thisObject = jsCast<JSWorkerLocation*>(cell); |
338 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
339 | if (thisObject->scriptExecutionContext()) |
340 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
341 | Base::heapSnapshot(cell, builder); |
342 | } |
343 | |
344 | bool JSWorkerLocationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) |
345 | { |
346 | auto* jsWorkerLocation = jsCast<JSWorkerLocation*>(handle.slot()->asCell()); |
347 | WorkerLocation* root = &jsWorkerLocation->wrapped(); |
348 | if (UNLIKELY(reason)) |
349 | *reason = "Reachable from WorkerLocation" ; |
350 | return visitor.containsOpaqueRoot(root); |
351 | } |
352 | |
353 | void JSWorkerLocationOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
354 | { |
355 | auto* jsWorkerLocation = static_cast<JSWorkerLocation*>(handle.slot()->asCell()); |
356 | auto& world = *static_cast<DOMWrapperWorld*>(context); |
357 | uncacheWrapper(world, &jsWorkerLocation->wrapped(), jsWorkerLocation); |
358 | } |
359 | |
360 | JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<WorkerLocation>&& impl) |
361 | { |
362 | // If you hit this failure the interface definition has the ImplementationLacksVTable |
363 | // attribute. You should remove that attribute. If the class has subclasses |
364 | // that may be passed through this toJS() function you should use the SkipVTableValidation |
365 | // attribute to WorkerLocation. |
366 | static_assert(!std::is_polymorphic<WorkerLocation>::value, "WorkerLocation is polymorphic but the IDL claims it is not" ); |
367 | return createWrapper<WorkerLocation>(globalObject, WTFMove(impl)); |
368 | } |
369 | |
370 | JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, WorkerLocation& impl) |
371 | { |
372 | return wrap(state, globalObject, impl); |
373 | } |
374 | |
375 | WorkerLocation* JSWorkerLocation::toWrapped(JSC::VM& vm, JSC::JSValue value) |
376 | { |
377 | if (auto* wrapper = jsDynamicCast<JSWorkerLocation*>(vm, value)) |
378 | return &wrapper->wrapped(); |
379 | return nullptr; |
380 | } |
381 | |
382 | } |
383 | |