blob: c549e1f45e4824bcbd1e8f35146e0c392a5cca95 [file] [log] [blame]
/*
This file is part of the WebKit open source project.
This file has been generated by generate-bindings.pl. DO NOT MODIFY!
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "config.h"
#include "JSInspectorFrontendHost.h"
#include "ExceptionCode.h"
#include "JSDOMBinding.h"
#include "JSDOMConvert.h"
#include "JSEvent.h"
#include "URL.h"
#include <runtime/Error.h>
#include <runtime/JSString.h>
#include <wtf/GetPtr.h>
using namespace JSC;
namespace WebCore {
// Functions
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionLoaded(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCloseWindow(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBringToFront(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionInspectedURLChanged(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetZoomFactor(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionZoomFactor(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionRequestSetDockSide(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowHeight(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowWidth(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionStartWindowDrag(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionMoveWindowBy(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionLocalizedStringsURL(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBackendCommandsURL(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionDebuggableType(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionInspectionLevel(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCopyText(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionKillText(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionOpenInNewTab(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCanSave(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSave(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionAppend(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionClose(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionPlatform(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionPort(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionShowContextMenu(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionDispatchEventAsContextMenuEvent(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSendMessageToBackend(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionUnbufferedLog(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionIsUnderTest(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBeep(JSC::ExecState*);
class JSInspectorFrontendHostPrototype : public JSC::JSNonFinalObject {
public:
typedef JSC::JSNonFinalObject Base;
static JSInspectorFrontendHostPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
{
JSInspectorFrontendHostPrototype* ptr = new (NotNull, JSC::allocateCell<JSInspectorFrontendHostPrototype>(vm.heap)) JSInspectorFrontendHostPrototype(vm, globalObject, structure);
ptr->finishCreation(vm);
return ptr;
}
DECLARE_INFO;
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
{
return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
}
private:
JSInspectorFrontendHostPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
: JSC::JSNonFinalObject(vm, structure)
{
}
void finishCreation(JSC::VM&);
};
/* Hash table for prototype */
static const HashTableValue JSInspectorFrontendHostPrototypeTableValues[] =
{
{ "loaded", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionLoaded), (intptr_t) (0) } },
{ "closeWindow", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionCloseWindow), (intptr_t) (0) } },
{ "bringToFront", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionBringToFront), (intptr_t) (0) } },
{ "inspectedURLChanged", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionInspectedURLChanged), (intptr_t) (1) } },
{ "setZoomFactor", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionSetZoomFactor), (intptr_t) (1) } },
{ "zoomFactor", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionZoomFactor), (intptr_t) (0) } },
{ "requestSetDockSide", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionRequestSetDockSide), (intptr_t) (1) } },
{ "setAttachedWindowHeight", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowHeight), (intptr_t) (1) } },
{ "setAttachedWindowWidth", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowWidth), (intptr_t) (1) } },
{ "startWindowDrag", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionStartWindowDrag), (intptr_t) (0) } },
{ "moveWindowBy", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionMoveWindowBy), (intptr_t) (2) } },
{ "localizedStringsURL", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionLocalizedStringsURL), (intptr_t) (0) } },
{ "backendCommandsURL", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionBackendCommandsURL), (intptr_t) (0) } },
{ "debuggableType", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionDebuggableType), (intptr_t) (0) } },
{ "inspectionLevel", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionInspectionLevel), (intptr_t) (0) } },
{ "copyText", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionCopyText), (intptr_t) (1) } },
{ "killText", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionKillText), (intptr_t) (3) } },
{ "openInNewTab", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionOpenInNewTab), (intptr_t) (1) } },
{ "canSave", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionCanSave), (intptr_t) (0) } },
{ "save", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionSave), (intptr_t) (4) } },
{ "append", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionAppend), (intptr_t) (2) } },
{ "close", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionClose), (intptr_t) (1) } },
{ "platform", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionPlatform), (intptr_t) (0) } },
{ "port", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionPort), (intptr_t) (0) } },
{ "showContextMenu", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionShowContextMenu), (intptr_t) (2) } },
{ "dispatchEventAsContextMenuEvent", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionDispatchEventAsContextMenuEvent), (intptr_t) (1) } },
{ "sendMessageToBackend", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionSendMessageToBackend), (intptr_t) (1) } },
{ "unbufferedLog", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionUnbufferedLog), (intptr_t) (1) } },
{ "isUnderTest", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionIsUnderTest), (intptr_t) (0) } },
{ "beep", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsInspectorFrontendHostPrototypeFunctionBeep), (intptr_t) (0) } },
};
const ClassInfo JSInspectorFrontendHostPrototype::s_info = { "InspectorFrontendHostPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSInspectorFrontendHostPrototype) };
void JSInspectorFrontendHostPrototype::finishCreation(VM& vm)
{
Base::finishCreation(vm);
reifyStaticProperties(vm, JSInspectorFrontendHostPrototypeTableValues, *this);
}
const ClassInfo JSInspectorFrontendHost::s_info = { "InspectorFrontendHost", &Base::s_info, 0, CREATE_METHOD_TABLE(JSInspectorFrontendHost) };
JSInspectorFrontendHost::JSInspectorFrontendHost(Structure* structure, JSDOMGlobalObject& globalObject, Ref<InspectorFrontendHost>&& impl)
: JSDOMWrapper<InspectorFrontendHost>(structure, globalObject, WTFMove(impl))
{
}
JSObject* JSInspectorFrontendHost::createPrototype(VM& vm, JSGlobalObject* globalObject)
{
return JSInspectorFrontendHostPrototype::create(vm, globalObject, JSInspectorFrontendHostPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
}
JSObject* JSInspectorFrontendHost::prototype(VM& vm, JSGlobalObject* globalObject)
{
return getDOMPrototype<JSInspectorFrontendHost>(vm, globalObject);
}
void JSInspectorFrontendHost::destroy(JSC::JSCell* cell)
{
JSInspectorFrontendHost* thisObject = static_cast<JSInspectorFrontendHost*>(cell);
thisObject->JSInspectorFrontendHost::~JSInspectorFrontendHost();
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionLoaded(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "loaded");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
impl.loaded();
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCloseWindow(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "closeWindow");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
impl.closeWindow();
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBringToFront(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "bringToFront");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
impl.bringToFront();
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionInspectedURLChanged(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "inspectedURLChanged");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 1))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto newURL = state->uncheckedArgument(0).toWTFString(state);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.inspectedURLChanged(WTFMove(newURL));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetZoomFactor(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "setZoomFactor");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 1))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto zoom = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.setZoomFactor(WTFMove(zoom));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionZoomFactor(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "zoomFactor");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
JSValue result = jsNumber(impl.zoomFactor());
return JSValue::encode(result);
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionRequestSetDockSide(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "requestSetDockSide");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 1))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto side = state->uncheckedArgument(0).toWTFString(state);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.requestSetDockSide(WTFMove(side));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowHeight(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "setAttachedWindowHeight");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 1))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto height = convert<uint32_t>(*state, state->uncheckedArgument(0), NormalConversion);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.setAttachedWindowHeight(WTFMove(height));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowWidth(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "setAttachedWindowWidth");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 1))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto width = convert<uint32_t>(*state, state->uncheckedArgument(0), NormalConversion);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.setAttachedWindowWidth(WTFMove(width));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionStartWindowDrag(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "startWindowDrag");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
impl.startWindowDrag();
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionMoveWindowBy(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "moveWindowBy");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 2))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto x = convert<float>(*state, state->uncheckedArgument(0), ShouldAllowNonFinite::Yes);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto y = convert<float>(*state, state->uncheckedArgument(1), ShouldAllowNonFinite::Yes);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.moveWindowBy(WTFMove(x), WTFMove(y));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionLocalizedStringsURL(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "localizedStringsURL");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
JSValue result = jsStringWithCache(state, impl.localizedStringsURL());
return JSValue::encode(result);
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBackendCommandsURL(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "backendCommandsURL");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
JSValue result = jsStringWithCache(state, impl.backendCommandsURL());
return JSValue::encode(result);
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionDebuggableType(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "debuggableType");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
JSValue result = jsStringWithCache(state, impl.debuggableType());
return JSValue::encode(result);
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionInspectionLevel(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "inspectionLevel");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
JSValue result = jsNumber(impl.inspectionLevel());
return JSValue::encode(result);
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCopyText(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "copyText");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 1))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto text = state->uncheckedArgument(0).toWTFString(state);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.copyText(WTFMove(text));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionKillText(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "killText");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 3))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto text = state->uncheckedArgument(0).toWTFString(state);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto shouldPrependToKillRing = state->uncheckedArgument(1).toBoolean(state);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto shouldStartNewSequence = state->uncheckedArgument(2).toBoolean(state);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.killText(WTFMove(text), WTFMove(shouldPrependToKillRing), WTFMove(shouldStartNewSequence));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionOpenInNewTab(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "openInNewTab");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 1))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto url = state->uncheckedArgument(0).toWTFString(state);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.openInNewTab(WTFMove(url));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCanSave(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "canSave");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
JSValue result = jsBoolean(impl.canSave());
return JSValue::encode(result);
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSave(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "save");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 4))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto url = state->uncheckedArgument(0).toWTFString(state);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto content = state->uncheckedArgument(1).toWTFString(state);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto base64Encoded = state->uncheckedArgument(2).toBoolean(state);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto forceSaveAs = state->uncheckedArgument(3).toBoolean(state);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.save(WTFMove(url), WTFMove(content), WTFMove(base64Encoded), WTFMove(forceSaveAs));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionAppend(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "append");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 2))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto url = state->uncheckedArgument(0).toWTFString(state);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto content = state->uncheckedArgument(1).toWTFString(state);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.append(WTFMove(url), WTFMove(content));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionClose(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "close");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 1))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto url = state->uncheckedArgument(0).toWTFString(state);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.close(WTFMove(url));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionPlatform(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "platform");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
JSValue result = jsStringWithCache(state, impl.platform());
return JSValue::encode(result);
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionPort(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "port");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
JSValue result = jsStringWithCache(state, impl.port());
return JSValue::encode(result);
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionShowContextMenu(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "showContextMenu");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
return JSValue::encode(castedThis->showContextMenu(*state));
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionDispatchEventAsContextMenuEvent(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "dispatchEventAsContextMenuEvent");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 1))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
Event* event = nullptr;
if (!state->uncheckedArgument(0).isUndefinedOrNull()) {
event = JSEvent::toWrapped(state->uncheckedArgument(0));
if (UNLIKELY(!event))
return throwArgumentTypeError(*state, throwScope, 0, "event", "InspectorFrontendHost", "dispatchEventAsContextMenuEvent", "Event");
}
impl.dispatchEventAsContextMenuEvent(WTFMove(event));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSendMessageToBackend(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "sendMessageToBackend");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 1))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto message = state->uncheckedArgument(0).toWTFString(state);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.sendMessageToBackend(WTFMove(message));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionUnbufferedLog(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "unbufferedLog");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 1))
return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
auto message = state->uncheckedArgument(0).toWTFString(state);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.unbufferedLog(WTFMove(message));
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionIsUnderTest(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "isUnderTest");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
JSValue result = jsBoolean(impl.isUnderTest());
return JSValue::encode(result);
}
EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBeep(ExecState* state)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSInspectorFrontendHost*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*state, throwScope, "InspectorFrontendHost", "beep");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSInspectorFrontendHost::info());
auto& impl = castedThis->wrapped();
impl.beep();
return JSValue::encode(jsUndefined());
}
bool JSInspectorFrontendHostOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
UNUSED_PARAM(handle);
UNUSED_PARAM(visitor);
return false;
}
void JSInspectorFrontendHostOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
auto* jsInspectorFrontendHost = jsCast<JSInspectorFrontendHost*>(handle.slot()->asCell());
auto& world = *static_cast<DOMWrapperWorld*>(context);
uncacheWrapper(world, &jsInspectorFrontendHost->wrapped(), jsInspectorFrontendHost);
}
JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<InspectorFrontendHost>&& impl)
{
#if COMPILER(CLANG)
// If you hit this failure the interface definition has the ImplementationLacksVTable
// attribute. You should remove that attribute. If the class has subclasses
// that may be passed through this toJS() function you should use the SkipVTableValidation
// attribute to InspectorFrontendHost.
static_assert(!__is_polymorphic(InspectorFrontendHost), "InspectorFrontendHost is polymorphic but the IDL claims it is not");
#endif
return createWrapper<InspectorFrontendHost>(globalObject, WTFMove(impl));
}
JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, InspectorFrontendHost& impl)
{
return wrap(state, globalObject, impl);
}
InspectorFrontendHost* JSInspectorFrontendHost::toWrapped(JSC::JSValue value)
{
if (auto* wrapper = jsDynamicCast<JSInspectorFrontendHost*>(value))
return &wrapper->wrapped();
return nullptr;
}
}