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 "JSDOMWindowBase.h"
24#include "JSDOMWrapper.h"
25
26namespace WebCore {
27
28class DOMWindow;
29
30class JSWindowProxy;
31
32class WEBCORE_EXPORT JSDOMWindow : public JSDOMWindowBase {
33public:
34 using Base = JSDOMWindowBase;
35 using DOMWrapped = DOMWindow;
36 static JSDOMWindow* create(JSC::VM& vm, JSC::Structure* structure, Ref<DOMWindow>&& impl, JSWindowProxy* proxy)
37 {
38 JSDOMWindow* ptr = new (NotNull, JSC::allocateCell<JSDOMWindow>(vm.heap)) JSDOMWindow(vm, structure, WTFMove(impl), proxy);
39 ptr->finishCreation(vm, proxy);
40 return ptr;
41 }
42
43 static const bool needsDestruction = false;
44
45 static DOMWindow* toWrapped(JSC::VM&, JSC::JSValue);
46 static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
47 static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
48 static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
49 static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
50 static bool putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);
51 static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);
52 static bool deleteProperty(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName);
53 static bool deletePropertyByIndex(JSC::JSCell*, JSC::ExecState*, unsigned);
54 static JSC::JSValue getPrototype(JSC::JSObject*, JSC::ExecState*);
55 static String toStringName(const JSC::JSObject*, JSC::ExecState*);
56 static bool preventExtensions(JSC::JSObject*, JSC::ExecState*);
57
58 DECLARE_INFO;
59
60 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
61 {
62 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::GlobalObjectType, StructureFlags), info());
63 }
64
65 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
66 static void visitChildren(JSCell*, JSC::SlotVisitor&);
67 void visitAdditionalChildren(JSC::SlotVisitor&);
68
69 static void visitOutputConstraints(JSCell*, JSC::SlotVisitor&);
70 template<typename, JSC::SubspaceAccess> static JSC::CompleteSubspace* subspaceFor(JSC::VM& vm) { return globalObjectOutputConstraintSubspaceFor(vm); }
71 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&);
72
73 // Custom attributes
74 JSC::JSValue window(JSC::ExecState&) const;
75 JSC::JSValue self(JSC::ExecState&) const;
76 JSC::JSValue frames(JSC::ExecState&) const;
77 void setOpener(JSC::ExecState&, JSC::JSValue);
78 JSC::JSValue event(JSC::ExecState&) const;
79
80 // Custom functions
81 JSC::JSValue showModalDialog(JSC::ExecState&);
82 JSC::JSValue queueMicrotask(JSC::ExecState&);
83 DOMWindow& wrapped() const
84 {
85 return static_cast<DOMWindow&>(Base::wrapped());
86 }
87public:
88 static const unsigned StructureFlags = Base::StructureFlags | JSC::HasStaticPropertyTable | JSC::ImplementsHasInstance | JSC::ImplementsDefaultHasInstance | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::IsImmutablePrototypeExoticObject | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames;
89protected:
90 JSDOMWindow(JSC::VM&, JSC::Structure*, Ref<DOMWindow>&&, JSWindowProxy*);
91 void finishCreation(JSC::VM&, JSWindowProxy*);
92};
93
94
95class JSDOMWindowPrototype : public JSC::JSNonFinalObject {
96public:
97 using Base = JSC::JSNonFinalObject;
98 static JSDOMWindowPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
99 {
100 JSDOMWindowPrototype* ptr = new (NotNull, JSC::allocateCell<JSDOMWindowPrototype>(vm.heap)) JSDOMWindowPrototype(vm, globalObject, structure);
101 ptr->finishCreation(vm);
102 return ptr;
103 }
104
105 DECLARE_INFO;
106 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
107 {
108 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
109 }
110
111private:
112 JSDOMWindowPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
113 : JSC::JSNonFinalObject(vm, structure)
114 {
115 }
116public:
117 static const unsigned StructureFlags = Base::StructureFlags | JSC::HasStaticPropertyTable | JSC::IsImmutablePrototypeExoticObject;
118};
119
120// Functions
121
122JSC::EncodedJSValue JSC_HOST_CALL jsDOMWindowInstanceFunctionClose(JSC::ExecState*);
123JSC::EncodedJSValue JSC_HOST_CALL jsDOMWindowInstanceFunctionFocus(JSC::ExecState*);
124JSC::EncodedJSValue JSC_HOST_CALL jsDOMWindowInstanceFunctionBlur(JSC::ExecState*);
125JSC::EncodedJSValue JSC_HOST_CALL jsDOMWindowInstanceFunctionPostMessage(JSC::ExecState*);
126
127// Attributes
128
129JSC::EncodedJSValue jsDOMWindowClosed(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
130template<> struct JSDOMWrapperConverterTraits<DOMWindow> {
131 using WrapperClass = JSDOMWindow;
132 using ToWrappedReturnType = DOMWindow*;
133};
134
135} // namespace WebCore
136