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