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 | #pragma once |
22 | |
23 | #include "JSDOMWrapper.h" |
24 | #include "JSWorkerGlobalScopeBase.h" |
25 | |
26 | namespace WebCore { |
27 | |
28 | class WorkerGlobalScope; |
29 | |
30 | class JSWorkerGlobalScope : public JSWorkerGlobalScopeBase { |
31 | public: |
32 | using Base = JSWorkerGlobalScopeBase; |
33 | using DOMWrapped = WorkerGlobalScope; |
34 | static JSWorkerGlobalScope* create(JSC::VM& vm, JSC::Structure* structure, Ref<WorkerGlobalScope>&& impl, JSC::JSProxy* proxy) |
35 | { |
36 | JSWorkerGlobalScope* ptr = new (NotNull, JSC::allocateCell<JSWorkerGlobalScope>(vm.heap)) JSWorkerGlobalScope(vm, structure, WTFMove(impl)); |
37 | ptr->finishCreation(vm, proxy); |
38 | return ptr; |
39 | } |
40 | |
41 | static const bool needsDestruction = false; |
42 | |
43 | static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&); |
44 | static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&); |
45 | static WorkerGlobalScope* toWrapped(JSC::VM&, JSC::JSValue); |
46 | |
47 | DECLARE_INFO; |
48 | |
49 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
50 | { |
51 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::GlobalObjectType, StructureFlags), info()); |
52 | } |
53 | |
54 | static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); |
55 | static void visitChildren(JSCell*, JSC::SlotVisitor&); |
56 | void visitAdditionalChildren(JSC::SlotVisitor&); |
57 | |
58 | static void visitOutputConstraints(JSCell*, JSC::SlotVisitor&); |
59 | template<typename, JSC::SubspaceAccess> static JSC::CompleteSubspace* subspaceFor(JSC::VM& vm) { return globalObjectOutputConstraintSubspaceFor(vm); } |
60 | static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); |
61 | |
62 | // Custom functions |
63 | JSC::JSValue queueMicrotask(JSC::ExecState&); |
64 | WorkerGlobalScope& wrapped() const |
65 | { |
66 | return static_cast<WorkerGlobalScope&>(Base::wrapped()); |
67 | } |
68 | public: |
69 | static const unsigned StructureFlags = Base::StructureFlags | JSC::HasStaticPropertyTable | JSC::IsImmutablePrototypeExoticObject; |
70 | protected: |
71 | JSWorkerGlobalScope(JSC::VM&, JSC::Structure*, Ref<WorkerGlobalScope>&&); |
72 | void finishCreation(JSC::VM&, JSC::JSProxy*); |
73 | }; |
74 | |
75 | |
76 | class JSWorkerGlobalScopePrototype : public JSC::JSNonFinalObject { |
77 | public: |
78 | using Base = JSC::JSNonFinalObject; |
79 | static JSWorkerGlobalScopePrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
80 | { |
81 | JSWorkerGlobalScopePrototype* ptr = new (NotNull, JSC::allocateCell<JSWorkerGlobalScopePrototype>(vm.heap)) JSWorkerGlobalScopePrototype(vm, globalObject, structure); |
82 | ptr->finishCreation(vm); |
83 | return ptr; |
84 | } |
85 | |
86 | DECLARE_INFO; |
87 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
88 | { |
89 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
90 | } |
91 | |
92 | private: |
93 | JSWorkerGlobalScopePrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
94 | : JSC::JSNonFinalObject(vm, structure) |
95 | { |
96 | } |
97 | |
98 | void finishCreation(JSC::VM&); |
99 | public: |
100 | static const unsigned StructureFlags = Base::StructureFlags | JSC::IsImmutablePrototypeExoticObject; |
101 | }; |
102 | |
103 | template<> struct JSDOMWrapperConverterTraits<WorkerGlobalScope> { |
104 | using WrapperClass = JSWorkerGlobalScope; |
105 | using ToWrappedReturnType = WorkerGlobalScope*; |
106 | }; |
107 | |
108 | } // namespace WebCore |
109 | |