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 "JSInspectorFrontendHost.h"
23
24#include "JSDOMAttribute.h"
25#include "JSDOMBinding.h"
26#include "JSDOMConvertBoolean.h"
27#include "JSDOMConvertInterface.h"
28#include "JSDOMConvertNumbers.h"
29#include "JSDOMConvertSequences.h"
30#include "JSDOMConvertStrings.h"
31#include "JSDOMExceptionHandling.h"
32#include "JSDOMOperation.h"
33#include "JSDOMWrapperCache.h"
34#include "JSEvent.h"
35#include "ScriptExecutionContext.h"
36#include <JavaScriptCore/HeapSnapshotBuilder.h>
37#include <JavaScriptCore/JSArray.h>
38#include <JavaScriptCore/JSCInlines.h>
39#include <wtf/GetPtr.h>
40#include <wtf/PointerPreparations.h>
41#include <wtf/URL.h>
42
43
44namespace WebCore {
45using namespace JSC;
46
47template<> InspectorFrontendHost::ContextMenuItem convertDictionary<InspectorFrontendHost::ContextMenuItem>(ExecState& state, JSValue value)
48{
49 VM& vm = state.vm();
50 auto throwScope = DECLARE_THROW_SCOPE(vm);
51 bool isNullOrUndefined = value.isUndefinedOrNull();
52 auto* object = isNullOrUndefined ? nullptr : value.getObject();
53 if (UNLIKELY(!isNullOrUndefined && !object)) {
54 throwTypeError(&state, throwScope);
55 return { };
56 }
57 InspectorFrontendHost::ContextMenuItem result;
58 JSValue checkedValue;
59 if (isNullOrUndefined)
60 checkedValue = jsUndefined();
61 else {
62 checkedValue = object->get(&state, Identifier::fromString(&state, "checked"));
63 RETURN_IF_EXCEPTION(throwScope, { });
64 }
65 if (!checkedValue.isUndefined()) {
66 result.checked = convert<IDLBoolean>(state, checkedValue);
67 RETURN_IF_EXCEPTION(throwScope, { });
68 }
69 JSValue enabledValue;
70 if (isNullOrUndefined)
71 enabledValue = jsUndefined();
72 else {
73 enabledValue = object->get(&state, Identifier::fromString(&state, "enabled"));
74 RETURN_IF_EXCEPTION(throwScope, { });
75 }
76 if (!enabledValue.isUndefined()) {
77 result.enabled = convert<IDLBoolean>(state, enabledValue);
78 RETURN_IF_EXCEPTION(throwScope, { });
79 }
80 JSValue idValue;
81 if (isNullOrUndefined)
82 idValue = jsUndefined();
83 else {
84 idValue = object->get(&state, Identifier::fromString(&state, "id"));
85 RETURN_IF_EXCEPTION(throwScope, { });
86 }
87 if (!idValue.isUndefined()) {
88 result.id = convert<IDLLong>(state, idValue);
89 RETURN_IF_EXCEPTION(throwScope, { });
90 }
91 JSValue labelValue;
92 if (isNullOrUndefined)
93 labelValue = jsUndefined();
94 else {
95 labelValue = object->get(&state, Identifier::fromString(&state, "label"));
96 RETURN_IF_EXCEPTION(throwScope, { });
97 }
98 if (!labelValue.isUndefined()) {
99 result.label = convert<IDLDOMString>(state, labelValue);
100 RETURN_IF_EXCEPTION(throwScope, { });
101 }
102 JSValue subItemsValue;
103 if (isNullOrUndefined)
104 subItemsValue = jsUndefined();
105 else {
106 subItemsValue = object->get(&state, Identifier::fromString(&state, "subItems"));
107 RETURN_IF_EXCEPTION(throwScope, { });
108 }
109 if (!subItemsValue.isUndefined()) {
110 result.subItems = convert<IDLSequence<IDLDictionary<InspectorFrontendHost::ContextMenuItem>>>(state, subItemsValue);
111 RETURN_IF_EXCEPTION(throwScope, { });
112 }
113 JSValue typeValue;
114 if (isNullOrUndefined)
115 typeValue = jsUndefined();
116 else {
117 typeValue = object->get(&state, Identifier::fromString(&state, "type"));
118 RETURN_IF_EXCEPTION(throwScope, { });
119 }
120 if (!typeValue.isUndefined()) {
121 result.type = convert<IDLDOMString>(state, typeValue);
122 RETURN_IF_EXCEPTION(throwScope, { });
123 }
124 return result;
125}
126
127// Functions
128
129JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionLoaded(JSC::ExecState*);
130JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCloseWindow(JSC::ExecState*);
131JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionReopen(JSC::ExecState*);
132JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBringToFront(JSC::ExecState*);
133JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionInspectedURLChanged(JSC::ExecState*);
134JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionShowCertificate(JSC::ExecState*);
135JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetZoomFactor(JSC::ExecState*);
136JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionZoomFactor(JSC::ExecState*);
137JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionUserInterfaceLayoutDirection(JSC::ExecState*);
138JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionRequestSetDockSide(JSC::ExecState*);
139JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowHeight(JSC::ExecState*);
140JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowWidth(JSC::ExecState*);
141JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetSheetRect(JSC::ExecState*);
142JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionStartWindowDrag(JSC::ExecState*);
143JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionMoveWindowBy(JSC::ExecState*);
144JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionLocalizedStringsURL(JSC::ExecState*);
145JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBackendCommandsURL(JSC::ExecState*);
146JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionDebuggableType(JSC::ExecState*);
147JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionInspectionLevel(JSC::ExecState*);
148JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCopyText(JSC::ExecState*);
149JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionKillText(JSC::ExecState*);
150JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionOpenInNewTab(JSC::ExecState*);
151JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCanSave(JSC::ExecState*);
152JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSave(JSC::ExecState*);
153JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionAppend(JSC::ExecState*);
154JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionClose(JSC::ExecState*);
155JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionPlatform(JSC::ExecState*);
156JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionPort(JSC::ExecState*);
157JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionShowContextMenu(JSC::ExecState*);
158JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionDispatchEventAsContextMenuEvent(JSC::ExecState*);
159JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSendMessageToBackend(JSC::ExecState*);
160JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionUnbufferedLog(JSC::ExecState*);
161JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionIsUnderTest(JSC::ExecState*);
162JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBeep(JSC::ExecState*);
163JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionInspectInspector(JSC::ExecState*);
164JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionIsBeingInspected(JSC::ExecState*);
165
166// Attributes
167
168JSC::EncodedJSValue jsInspectorFrontendHostSupportsShowCertificate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
169JSC::EncodedJSValue jsInspectorFrontendHostIsRemote(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
170
171class JSInspectorFrontendHostPrototype : public JSC::JSNonFinalObject {
172public:
173 using Base = JSC::JSNonFinalObject;
174 static JSInspectorFrontendHostPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
175 {
176 JSInspectorFrontendHostPrototype* ptr = new (NotNull, JSC::allocateCell<JSInspectorFrontendHostPrototype>(vm.heap)) JSInspectorFrontendHostPrototype(vm, globalObject, structure);
177 ptr->finishCreation(vm);
178 return ptr;
179 }
180
181 DECLARE_INFO;
182 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
183 {
184 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
185 }
186
187private:
188 JSInspectorFrontendHostPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
189 : JSC::JSNonFinalObject(vm, structure)
190 {
191 }
192
193 void finishCreation(JSC::VM&);
194};
195
196/* Hash table for prototype */
197
198static const HashTableValue JSInspectorFrontendHostPrototypeTableValues[] =
199{
200 { "supportsShowCertificate", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsInspectorFrontendHostSupportsShowCertificate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
201 { "isRemote", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsInspectorFrontendHostIsRemote), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
202 { "loaded", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionLoaded), (intptr_t) (0) } },
203 { "closeWindow", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionCloseWindow), (intptr_t) (0) } },
204 { "reopen", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionReopen), (intptr_t) (0) } },
205 { "bringToFront", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionBringToFront), (intptr_t) (0) } },
206 { "inspectedURLChanged", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionInspectedURLChanged), (intptr_t) (1) } },
207 { "showCertificate", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionShowCertificate), (intptr_t) (1) } },
208 { "setZoomFactor", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionSetZoomFactor), (intptr_t) (1) } },
209 { "zoomFactor", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionZoomFactor), (intptr_t) (0) } },
210 { "userInterfaceLayoutDirection", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionUserInterfaceLayoutDirection), (intptr_t) (0) } },
211 { "requestSetDockSide", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionRequestSetDockSide), (intptr_t) (1) } },
212 { "setAttachedWindowHeight", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowHeight), (intptr_t) (1) } },
213 { "setAttachedWindowWidth", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowWidth), (intptr_t) (1) } },
214 { "setSheetRect", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionSetSheetRect), (intptr_t) (4) } },
215 { "startWindowDrag", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionStartWindowDrag), (intptr_t) (0) } },
216 { "moveWindowBy", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionMoveWindowBy), (intptr_t) (2) } },
217 { "localizedStringsURL", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionLocalizedStringsURL), (intptr_t) (0) } },
218 { "backendCommandsURL", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionBackendCommandsURL), (intptr_t) (0) } },
219 { "debuggableType", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionDebuggableType), (intptr_t) (0) } },
220 { "inspectionLevel", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionInspectionLevel), (intptr_t) (0) } },
221 { "copyText", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionCopyText), (intptr_t) (1) } },
222 { "killText", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionKillText), (intptr_t) (3) } },
223 { "openInNewTab", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionOpenInNewTab), (intptr_t) (1) } },
224 { "canSave", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionCanSave), (intptr_t) (0) } },
225 { "save", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionSave), (intptr_t) (4) } },
226 { "append", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionAppend), (intptr_t) (2) } },
227 { "close", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionClose), (intptr_t) (1) } },
228 { "platform", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionPlatform), (intptr_t) (0) } },
229 { "port", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionPort), (intptr_t) (0) } },
230 { "showContextMenu", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionShowContextMenu), (intptr_t) (2) } },
231 { "dispatchEventAsContextMenuEvent", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionDispatchEventAsContextMenuEvent), (intptr_t) (1) } },
232 { "sendMessageToBackend", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionSendMessageToBackend), (intptr_t) (1) } },
233 { "unbufferedLog", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionUnbufferedLog), (intptr_t) (1) } },
234 { "isUnderTest", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionIsUnderTest), (intptr_t) (0) } },
235 { "beep", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionBeep), (intptr_t) (0) } },
236 { "inspectInspector", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionInspectInspector), (intptr_t) (0) } },
237 { "isBeingInspected", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsInspectorFrontendHostPrototypeFunctionIsBeingInspected), (intptr_t) (0) } },
238};
239
240const ClassInfo JSInspectorFrontendHostPrototype::s_info = { "InspectorFrontendHostPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSInspectorFrontendHostPrototype) };
241
242void JSInspectorFrontendHostPrototype::finishCreation(VM& vm)
243{
244 Base::finishCreation(vm);
245 reifyStaticProperties(vm, JSInspectorFrontendHost::info(), JSInspectorFrontendHostPrototypeTableValues, *this);
246}
247
248const ClassInfo JSInspectorFrontendHost::s_info = { "InspectorFrontendHost", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSInspectorFrontendHost) };
249
250JSInspectorFrontendHost::JSInspectorFrontendHost(Structure* structure, JSDOMGlobalObject& globalObject, Ref<InspectorFrontendHost>&& impl)
251 : JSDOMWrapper<InspectorFrontendHost>(structure, globalObject, WTFMove(impl))
252{
253}
254
255void JSInspectorFrontendHost::finishCreation(VM& vm)
256{
257 Base::finishCreation(vm);
258 ASSERT(inherits(vm, info()));
259
260}
261
262JSObject* JSInspectorFrontendHost::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
263{
264 return JSInspectorFrontendHostPrototype::create(vm, &globalObject, JSInspectorFrontendHostPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
265}
266
267JSObject* JSInspectorFrontendHost::prototype(VM& vm, JSDOMGlobalObject& globalObject)
268{
269 return getDOMPrototype<JSInspectorFrontendHost>(vm, globalObject);
270}
271
272void JSInspectorFrontendHost::destroy(JSC::JSCell* cell)
273{
274 JSInspectorFrontendHost* thisObject = static_cast<JSInspectorFrontendHost*>(cell);
275 thisObject->JSInspectorFrontendHost::~JSInspectorFrontendHost();
276}
277
278template<> inline JSInspectorFrontendHost* IDLAttribute<JSInspectorFrontendHost>::cast(ExecState& state, EncodedJSValue thisValue)
279{
280 return jsDynamicCast<JSInspectorFrontendHost*>(state.vm(), JSValue::decode(thisValue));
281}
282
283template<> inline JSInspectorFrontendHost* IDLOperation<JSInspectorFrontendHost>::cast(ExecState& state)
284{
285 return jsDynamicCast<JSInspectorFrontendHost*>(state.vm(), state.thisValue());
286}
287
288static inline JSValue jsInspectorFrontendHostSupportsShowCertificateGetter(ExecState& state, JSInspectorFrontendHost& thisObject, ThrowScope& throwScope)
289{
290 UNUSED_PARAM(throwScope);
291 UNUSED_PARAM(state);
292 auto& impl = thisObject.wrapped();
293 JSValue result = toJS<IDLBoolean>(state, throwScope, impl.supportsShowCertificate());
294 return result;
295}
296
297EncodedJSValue jsInspectorFrontendHostSupportsShowCertificate(ExecState* state, EncodedJSValue thisValue, PropertyName)
298{
299 return IDLAttribute<JSInspectorFrontendHost>::get<jsInspectorFrontendHostSupportsShowCertificateGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "supportsShowCertificate");
300}
301
302static inline JSValue jsInspectorFrontendHostIsRemoteGetter(ExecState& state, JSInspectorFrontendHost& thisObject, ThrowScope& throwScope)
303{
304 UNUSED_PARAM(throwScope);
305 UNUSED_PARAM(state);
306 auto& impl = thisObject.wrapped();
307 JSValue result = toJS<IDLBoolean>(state, throwScope, impl.isRemote());
308 return result;
309}
310
311EncodedJSValue jsInspectorFrontendHostIsRemote(ExecState* state, EncodedJSValue thisValue, PropertyName)
312{
313 return IDLAttribute<JSInspectorFrontendHost>::get<jsInspectorFrontendHostIsRemoteGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "isRemote");
314}
315
316static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionLoadedBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
317{
318 UNUSED_PARAM(state);
319 UNUSED_PARAM(throwScope);
320 auto& impl = castedThis->wrapped();
321 impl.loaded();
322 return JSValue::encode(jsUndefined());
323}
324
325EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionLoaded(ExecState* state)
326{
327 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionLoadedBody>(*state, "loaded");
328}
329
330static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionCloseWindowBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
331{
332 UNUSED_PARAM(state);
333 UNUSED_PARAM(throwScope);
334 auto& impl = castedThis->wrapped();
335 impl.closeWindow();
336 return JSValue::encode(jsUndefined());
337}
338
339EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCloseWindow(ExecState* state)
340{
341 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionCloseWindowBody>(*state, "closeWindow");
342}
343
344static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionReopenBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
345{
346 UNUSED_PARAM(state);
347 UNUSED_PARAM(throwScope);
348 auto& impl = castedThis->wrapped();
349 impl.reopen();
350 return JSValue::encode(jsUndefined());
351}
352
353EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionReopen(ExecState* state)
354{
355 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionReopenBody>(*state, "reopen");
356}
357
358static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionBringToFrontBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
359{
360 UNUSED_PARAM(state);
361 UNUSED_PARAM(throwScope);
362 auto& impl = castedThis->wrapped();
363 impl.bringToFront();
364 return JSValue::encode(jsUndefined());
365}
366
367EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBringToFront(ExecState* state)
368{
369 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionBringToFrontBody>(*state, "bringToFront");
370}
371
372static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionInspectedURLChangedBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
373{
374 UNUSED_PARAM(state);
375 UNUSED_PARAM(throwScope);
376 auto& impl = castedThis->wrapped();
377 if (UNLIKELY(state->argumentCount() < 1))
378 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
379 auto newURL = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
380 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
381 impl.inspectedURLChanged(WTFMove(newURL));
382 return JSValue::encode(jsUndefined());
383}
384
385EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionInspectedURLChanged(ExecState* state)
386{
387 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionInspectedURLChangedBody>(*state, "inspectedURLChanged");
388}
389
390static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionShowCertificateBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
391{
392 UNUSED_PARAM(state);
393 UNUSED_PARAM(throwScope);
394 auto& impl = castedThis->wrapped();
395 if (UNLIKELY(state->argumentCount() < 1))
396 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
397 auto serializedCertificate = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
398 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
399 return JSValue::encode(toJS<IDLBoolean>(impl.showCertificate(WTFMove(serializedCertificate))));
400}
401
402EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionShowCertificate(ExecState* state)
403{
404 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionShowCertificateBody>(*state, "showCertificate");
405}
406
407static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionSetZoomFactorBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
408{
409 UNUSED_PARAM(state);
410 UNUSED_PARAM(throwScope);
411 auto& impl = castedThis->wrapped();
412 if (UNLIKELY(state->argumentCount() < 1))
413 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
414 auto zoom = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0));
415 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
416 impl.setZoomFactor(WTFMove(zoom));
417 return JSValue::encode(jsUndefined());
418}
419
420EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetZoomFactor(ExecState* state)
421{
422 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionSetZoomFactorBody>(*state, "setZoomFactor");
423}
424
425static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionZoomFactorBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
426{
427 UNUSED_PARAM(state);
428 UNUSED_PARAM(throwScope);
429 auto& impl = castedThis->wrapped();
430 return JSValue::encode(toJS<IDLFloat>(impl.zoomFactor()));
431}
432
433EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionZoomFactor(ExecState* state)
434{
435 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionZoomFactorBody>(*state, "zoomFactor");
436}
437
438static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionUserInterfaceLayoutDirectionBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
439{
440 UNUSED_PARAM(state);
441 UNUSED_PARAM(throwScope);
442 auto& impl = castedThis->wrapped();
443 return JSValue::encode(toJS<IDLDOMString>(*state, impl.userInterfaceLayoutDirection()));
444}
445
446EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionUserInterfaceLayoutDirection(ExecState* state)
447{
448 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionUserInterfaceLayoutDirectionBody>(*state, "userInterfaceLayoutDirection");
449}
450
451static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionRequestSetDockSideBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
452{
453 UNUSED_PARAM(state);
454 UNUSED_PARAM(throwScope);
455 auto& impl = castedThis->wrapped();
456 if (UNLIKELY(state->argumentCount() < 1))
457 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
458 auto side = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
459 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
460 impl.requestSetDockSide(WTFMove(side));
461 return JSValue::encode(jsUndefined());
462}
463
464EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionRequestSetDockSide(ExecState* state)
465{
466 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionRequestSetDockSideBody>(*state, "requestSetDockSide");
467}
468
469static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowHeightBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
470{
471 UNUSED_PARAM(state);
472 UNUSED_PARAM(throwScope);
473 auto& impl = castedThis->wrapped();
474 if (UNLIKELY(state->argumentCount() < 1))
475 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
476 auto height = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(0));
477 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
478 impl.setAttachedWindowHeight(WTFMove(height));
479 return JSValue::encode(jsUndefined());
480}
481
482EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowHeight(ExecState* state)
483{
484 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowHeightBody>(*state, "setAttachedWindowHeight");
485}
486
487static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowWidthBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
488{
489 UNUSED_PARAM(state);
490 UNUSED_PARAM(throwScope);
491 auto& impl = castedThis->wrapped();
492 if (UNLIKELY(state->argumentCount() < 1))
493 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
494 auto width = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(0));
495 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
496 impl.setAttachedWindowWidth(WTFMove(width));
497 return JSValue::encode(jsUndefined());
498}
499
500EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowWidth(ExecState* state)
501{
502 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowWidthBody>(*state, "setAttachedWindowWidth");
503}
504
505static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionSetSheetRectBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
506{
507 UNUSED_PARAM(state);
508 UNUSED_PARAM(throwScope);
509 auto& impl = castedThis->wrapped();
510 if (UNLIKELY(state->argumentCount() < 4))
511 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
512 auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0));
513 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
514 auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1));
515 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
516 auto width = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(2));
517 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
518 auto height = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(3));
519 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
520 impl.setSheetRect(WTFMove(x), WTFMove(y), WTFMove(width), WTFMove(height));
521 return JSValue::encode(jsUndefined());
522}
523
524EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetSheetRect(ExecState* state)
525{
526 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionSetSheetRectBody>(*state, "setSheetRect");
527}
528
529static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionStartWindowDragBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
530{
531 UNUSED_PARAM(state);
532 UNUSED_PARAM(throwScope);
533 auto& impl = castedThis->wrapped();
534 impl.startWindowDrag();
535 return JSValue::encode(jsUndefined());
536}
537
538EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionStartWindowDrag(ExecState* state)
539{
540 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionStartWindowDragBody>(*state, "startWindowDrag");
541}
542
543static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionMoveWindowByBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
544{
545 UNUSED_PARAM(state);
546 UNUSED_PARAM(throwScope);
547 auto& impl = castedThis->wrapped();
548 if (UNLIKELY(state->argumentCount() < 2))
549 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
550 auto x = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0));
551 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
552 auto y = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1));
553 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
554 impl.moveWindowBy(WTFMove(x), WTFMove(y));
555 return JSValue::encode(jsUndefined());
556}
557
558EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionMoveWindowBy(ExecState* state)
559{
560 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionMoveWindowByBody>(*state, "moveWindowBy");
561}
562
563static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionLocalizedStringsURLBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
564{
565 UNUSED_PARAM(state);
566 UNUSED_PARAM(throwScope);
567 auto& impl = castedThis->wrapped();
568 return JSValue::encode(toJS<IDLDOMString>(*state, impl.localizedStringsURL()));
569}
570
571EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionLocalizedStringsURL(ExecState* state)
572{
573 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionLocalizedStringsURLBody>(*state, "localizedStringsURL");
574}
575
576static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionBackendCommandsURLBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
577{
578 UNUSED_PARAM(state);
579 UNUSED_PARAM(throwScope);
580 auto& impl = castedThis->wrapped();
581 return JSValue::encode(toJS<IDLDOMString>(*state, impl.backendCommandsURL()));
582}
583
584EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBackendCommandsURL(ExecState* state)
585{
586 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionBackendCommandsURLBody>(*state, "backendCommandsURL");
587}
588
589static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionDebuggableTypeBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
590{
591 UNUSED_PARAM(state);
592 UNUSED_PARAM(throwScope);
593 auto& impl = castedThis->wrapped();
594 return JSValue::encode(toJS<IDLDOMString>(*state, impl.debuggableType()));
595}
596
597EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionDebuggableType(ExecState* state)
598{
599 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionDebuggableTypeBody>(*state, "debuggableType");
600}
601
602static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionInspectionLevelBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
603{
604 UNUSED_PARAM(state);
605 UNUSED_PARAM(throwScope);
606 auto& impl = castedThis->wrapped();
607 return JSValue::encode(toJS<IDLUnsignedLong>(impl.inspectionLevel()));
608}
609
610EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionInspectionLevel(ExecState* state)
611{
612 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionInspectionLevelBody>(*state, "inspectionLevel");
613}
614
615static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionCopyTextBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
616{
617 UNUSED_PARAM(state);
618 UNUSED_PARAM(throwScope);
619 auto& impl = castedThis->wrapped();
620 if (UNLIKELY(state->argumentCount() < 1))
621 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
622 auto text = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
623 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
624 impl.copyText(WTFMove(text));
625 return JSValue::encode(jsUndefined());
626}
627
628EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCopyText(ExecState* state)
629{
630 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionCopyTextBody>(*state, "copyText");
631}
632
633static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionKillTextBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
634{
635 UNUSED_PARAM(state);
636 UNUSED_PARAM(throwScope);
637 auto& impl = castedThis->wrapped();
638 if (UNLIKELY(state->argumentCount() < 3))
639 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
640 auto text = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
641 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
642 auto shouldPrependToKillRing = convert<IDLBoolean>(*state, state->uncheckedArgument(1));
643 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
644 auto shouldStartNewSequence = convert<IDLBoolean>(*state, state->uncheckedArgument(2));
645 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
646 impl.killText(WTFMove(text), WTFMove(shouldPrependToKillRing), WTFMove(shouldStartNewSequence));
647 return JSValue::encode(jsUndefined());
648}
649
650EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionKillText(ExecState* state)
651{
652 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionKillTextBody>(*state, "killText");
653}
654
655static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionOpenInNewTabBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
656{
657 UNUSED_PARAM(state);
658 UNUSED_PARAM(throwScope);
659 auto& impl = castedThis->wrapped();
660 if (UNLIKELY(state->argumentCount() < 1))
661 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
662 auto url = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
663 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
664 impl.openInNewTab(WTFMove(url));
665 return JSValue::encode(jsUndefined());
666}
667
668EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionOpenInNewTab(ExecState* state)
669{
670 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionOpenInNewTabBody>(*state, "openInNewTab");
671}
672
673static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionCanSaveBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
674{
675 UNUSED_PARAM(state);
676 UNUSED_PARAM(throwScope);
677 auto& impl = castedThis->wrapped();
678 return JSValue::encode(toJS<IDLBoolean>(impl.canSave()));
679}
680
681EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCanSave(ExecState* state)
682{
683 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionCanSaveBody>(*state, "canSave");
684}
685
686static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionSaveBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
687{
688 UNUSED_PARAM(state);
689 UNUSED_PARAM(throwScope);
690 auto& impl = castedThis->wrapped();
691 if (UNLIKELY(state->argumentCount() < 4))
692 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
693 auto url = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
694 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
695 auto content = convert<IDLDOMString>(*state, state->uncheckedArgument(1));
696 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
697 auto base64Encoded = convert<IDLBoolean>(*state, state->uncheckedArgument(2));
698 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
699 auto forceSaveAs = convert<IDLBoolean>(*state, state->uncheckedArgument(3));
700 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
701 impl.save(WTFMove(url), WTFMove(content), WTFMove(base64Encoded), WTFMove(forceSaveAs));
702 return JSValue::encode(jsUndefined());
703}
704
705EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSave(ExecState* state)
706{
707 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionSaveBody>(*state, "save");
708}
709
710static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionAppendBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
711{
712 UNUSED_PARAM(state);
713 UNUSED_PARAM(throwScope);
714 auto& impl = castedThis->wrapped();
715 if (UNLIKELY(state->argumentCount() < 2))
716 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
717 auto url = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
718 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
719 auto content = convert<IDLDOMString>(*state, state->uncheckedArgument(1));
720 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
721 impl.append(WTFMove(url), WTFMove(content));
722 return JSValue::encode(jsUndefined());
723}
724
725EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionAppend(ExecState* state)
726{
727 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionAppendBody>(*state, "append");
728}
729
730static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionCloseBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
731{
732 UNUSED_PARAM(state);
733 UNUSED_PARAM(throwScope);
734 auto& impl = castedThis->wrapped();
735 if (UNLIKELY(state->argumentCount() < 1))
736 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
737 auto url = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
738 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
739 impl.close(WTFMove(url));
740 return JSValue::encode(jsUndefined());
741}
742
743EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionClose(ExecState* state)
744{
745 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionCloseBody>(*state, "close");
746}
747
748static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionPlatformBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
749{
750 UNUSED_PARAM(state);
751 UNUSED_PARAM(throwScope);
752 auto& impl = castedThis->wrapped();
753 return JSValue::encode(toJS<IDLDOMString>(*state, impl.platform()));
754}
755
756EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionPlatform(ExecState* state)
757{
758 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionPlatformBody>(*state, "platform");
759}
760
761static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionPortBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
762{
763 UNUSED_PARAM(state);
764 UNUSED_PARAM(throwScope);
765 auto& impl = castedThis->wrapped();
766 return JSValue::encode(toJS<IDLDOMString>(*state, impl.port()));
767}
768
769EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionPort(ExecState* state)
770{
771 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionPortBody>(*state, "port");
772}
773
774static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionShowContextMenuBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
775{
776 UNUSED_PARAM(state);
777 UNUSED_PARAM(throwScope);
778 auto& impl = castedThis->wrapped();
779 if (UNLIKELY(state->argumentCount() < 2))
780 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
781 auto event = convert<IDLInterface<Event>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "event", "InspectorFrontendHost", "showContextMenu", "Event"); });
782 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
783 auto items = convert<IDLSequence<IDLDictionary<InspectorFrontendHost::ContextMenuItem>>>(*state, state->uncheckedArgument(1));
784 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
785 impl.showContextMenu(*event, WTFMove(items));
786 return JSValue::encode(jsUndefined());
787}
788
789EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionShowContextMenu(ExecState* state)
790{
791 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionShowContextMenuBody>(*state, "showContextMenu");
792}
793
794static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionDispatchEventAsContextMenuEventBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
795{
796 UNUSED_PARAM(state);
797 UNUSED_PARAM(throwScope);
798 auto& impl = castedThis->wrapped();
799 if (UNLIKELY(state->argumentCount() < 1))
800 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
801 auto event = convert<IDLInterface<Event>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "event", "InspectorFrontendHost", "dispatchEventAsContextMenuEvent", "Event"); });
802 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
803 impl.dispatchEventAsContextMenuEvent(*event);
804 return JSValue::encode(jsUndefined());
805}
806
807EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionDispatchEventAsContextMenuEvent(ExecState* state)
808{
809 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionDispatchEventAsContextMenuEventBody>(*state, "dispatchEventAsContextMenuEvent");
810}
811
812static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionSendMessageToBackendBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
813{
814 UNUSED_PARAM(state);
815 UNUSED_PARAM(throwScope);
816 auto& impl = castedThis->wrapped();
817 if (UNLIKELY(state->argumentCount() < 1))
818 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
819 auto message = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
820 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
821 impl.sendMessageToBackend(WTFMove(message));
822 return JSValue::encode(jsUndefined());
823}
824
825EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSendMessageToBackend(ExecState* state)
826{
827 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionSendMessageToBackendBody>(*state, "sendMessageToBackend");
828}
829
830static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionUnbufferedLogBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
831{
832 UNUSED_PARAM(state);
833 UNUSED_PARAM(throwScope);
834 auto& impl = castedThis->wrapped();
835 if (UNLIKELY(state->argumentCount() < 1))
836 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
837 auto message = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
838 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
839 impl.unbufferedLog(WTFMove(message));
840 return JSValue::encode(jsUndefined());
841}
842
843EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionUnbufferedLog(ExecState* state)
844{
845 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionUnbufferedLogBody>(*state, "unbufferedLog");
846}
847
848static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionIsUnderTestBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
849{
850 UNUSED_PARAM(state);
851 UNUSED_PARAM(throwScope);
852 auto& impl = castedThis->wrapped();
853 return JSValue::encode(toJS<IDLBoolean>(impl.isUnderTest()));
854}
855
856EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionIsUnderTest(ExecState* state)
857{
858 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionIsUnderTestBody>(*state, "isUnderTest");
859}
860
861static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionBeepBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
862{
863 UNUSED_PARAM(state);
864 UNUSED_PARAM(throwScope);
865 auto& impl = castedThis->wrapped();
866 impl.beep();
867 return JSValue::encode(jsUndefined());
868}
869
870EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBeep(ExecState* state)
871{
872 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionBeepBody>(*state, "beep");
873}
874
875static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionInspectInspectorBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
876{
877 UNUSED_PARAM(state);
878 UNUSED_PARAM(throwScope);
879 auto& impl = castedThis->wrapped();
880 impl.inspectInspector();
881 return JSValue::encode(jsUndefined());
882}
883
884EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionInspectInspector(ExecState* state)
885{
886 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionInspectInspectorBody>(*state, "inspectInspector");
887}
888
889static inline JSC::EncodedJSValue jsInspectorFrontendHostPrototypeFunctionIsBeingInspectedBody(JSC::ExecState* state, typename IDLOperation<JSInspectorFrontendHost>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
890{
891 UNUSED_PARAM(state);
892 UNUSED_PARAM(throwScope);
893 auto& impl = castedThis->wrapped();
894 return JSValue::encode(toJS<IDLBoolean>(impl.isBeingInspected()));
895}
896
897EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionIsBeingInspected(ExecState* state)
898{
899 return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionIsBeingInspectedBody>(*state, "isBeingInspected");
900}
901
902void JSInspectorFrontendHost::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)
903{
904 auto* thisObject = jsCast<JSInspectorFrontendHost*>(cell);
905 builder.setWrappedObjectForCell(cell, &thisObject->wrapped());
906 if (thisObject->scriptExecutionContext())
907 builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
908 Base::heapSnapshot(cell, builder);
909}
910
911bool JSInspectorFrontendHostOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason)
912{
913 UNUSED_PARAM(handle);
914 UNUSED_PARAM(visitor);
915 UNUSED_PARAM(reason);
916 return false;
917}
918
919void JSInspectorFrontendHostOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
920{
921 auto* jsInspectorFrontendHost = static_cast<JSInspectorFrontendHost*>(handle.slot()->asCell());
922 auto& world = *static_cast<DOMWrapperWorld*>(context);
923 uncacheWrapper(world, &jsInspectorFrontendHost->wrapped(), jsInspectorFrontendHost);
924}
925
926JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<InspectorFrontendHost>&& impl)
927{
928 // If you hit this failure the interface definition has the ImplementationLacksVTable
929 // attribute. You should remove that attribute. If the class has subclasses
930 // that may be passed through this toJS() function you should use the SkipVTableValidation
931 // attribute to InspectorFrontendHost.
932 static_assert(!std::is_polymorphic<InspectorFrontendHost>::value, "InspectorFrontendHost is polymorphic but the IDL claims it is not");
933 return createWrapper<InspectorFrontendHost>(globalObject, WTFMove(impl));
934}
935
936JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, InspectorFrontendHost& impl)
937{
938 return wrap(state, globalObject, impl);
939}
940
941InspectorFrontendHost* JSInspectorFrontendHost::toWrapped(JSC::VM& vm, JSC::JSValue value)
942{
943 if (auto* wrapper = jsDynamicCast<JSInspectorFrontendHost*>(vm, value))
944 return &wrapper->wrapped();
945 return nullptr;
946}
947
948}
949