| 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 | |
| 44 | namespace WebCore { |
| 45 | using namespace JSC; |
| 46 | |
| 47 | template<> 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 | |
| 129 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionLoaded(JSC::ExecState*); |
| 130 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCloseWindow(JSC::ExecState*); |
| 131 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionReopen(JSC::ExecState*); |
| 132 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBringToFront(JSC::ExecState*); |
| 133 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionInspectedURLChanged(JSC::ExecState*); |
| 134 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionShowCertificate(JSC::ExecState*); |
| 135 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetZoomFactor(JSC::ExecState*); |
| 136 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionZoomFactor(JSC::ExecState*); |
| 137 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionUserInterfaceLayoutDirection(JSC::ExecState*); |
| 138 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionRequestSetDockSide(JSC::ExecState*); |
| 139 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowHeight(JSC::ExecState*); |
| 140 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowWidth(JSC::ExecState*); |
| 141 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetSheetRect(JSC::ExecState*); |
| 142 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionStartWindowDrag(JSC::ExecState*); |
| 143 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionMoveWindowBy(JSC::ExecState*); |
| 144 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionLocalizedStringsURL(JSC::ExecState*); |
| 145 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBackendCommandsURL(JSC::ExecState*); |
| 146 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionDebuggableType(JSC::ExecState*); |
| 147 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionInspectionLevel(JSC::ExecState*); |
| 148 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCopyText(JSC::ExecState*); |
| 149 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionKillText(JSC::ExecState*); |
| 150 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionOpenInNewTab(JSC::ExecState*); |
| 151 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCanSave(JSC::ExecState*); |
| 152 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSave(JSC::ExecState*); |
| 153 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionAppend(JSC::ExecState*); |
| 154 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionClose(JSC::ExecState*); |
| 155 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionPlatform(JSC::ExecState*); |
| 156 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionPort(JSC::ExecState*); |
| 157 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionShowContextMenu(JSC::ExecState*); |
| 158 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionDispatchEventAsContextMenuEvent(JSC::ExecState*); |
| 159 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSendMessageToBackend(JSC::ExecState*); |
| 160 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionUnbufferedLog(JSC::ExecState*); |
| 161 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionIsUnderTest(JSC::ExecState*); |
| 162 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBeep(JSC::ExecState*); |
| 163 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionInspectInspector(JSC::ExecState*); |
| 164 | JSC::EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionIsBeingInspected(JSC::ExecState*); |
| 165 | |
| 166 | // Attributes |
| 167 | |
| 168 | JSC::EncodedJSValue jsInspectorFrontendHostSupportsShowCertificate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 169 | JSC::EncodedJSValue jsInspectorFrontendHostIsRemote(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 170 | |
| 171 | class JSInspectorFrontendHostPrototype : public JSC::JSNonFinalObject { |
| 172 | public: |
| 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 | |
| 187 | private: |
| 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 | |
| 198 | static 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 | |
| 240 | const ClassInfo JSInspectorFrontendHostPrototype::s_info = { "InspectorFrontendHostPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSInspectorFrontendHostPrototype) }; |
| 241 | |
| 242 | void JSInspectorFrontendHostPrototype::finishCreation(VM& vm) |
| 243 | { |
| 244 | Base::finishCreation(vm); |
| 245 | reifyStaticProperties(vm, JSInspectorFrontendHost::info(), JSInspectorFrontendHostPrototypeTableValues, *this); |
| 246 | } |
| 247 | |
| 248 | const ClassInfo JSInspectorFrontendHost::s_info = { "InspectorFrontendHost" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSInspectorFrontendHost) }; |
| 249 | |
| 250 | JSInspectorFrontendHost::JSInspectorFrontendHost(Structure* structure, JSDOMGlobalObject& globalObject, Ref<InspectorFrontendHost>&& impl) |
| 251 | : JSDOMWrapper<InspectorFrontendHost>(structure, globalObject, WTFMove(impl)) |
| 252 | { |
| 253 | } |
| 254 | |
| 255 | void JSInspectorFrontendHost::finishCreation(VM& vm) |
| 256 | { |
| 257 | Base::finishCreation(vm); |
| 258 | ASSERT(inherits(vm, info())); |
| 259 | |
| 260 | } |
| 261 | |
| 262 | JSObject* JSInspectorFrontendHost::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
| 263 | { |
| 264 | return JSInspectorFrontendHostPrototype::create(vm, &globalObject, JSInspectorFrontendHostPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); |
| 265 | } |
| 266 | |
| 267 | JSObject* JSInspectorFrontendHost::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
| 268 | { |
| 269 | return getDOMPrototype<JSInspectorFrontendHost>(vm, globalObject); |
| 270 | } |
| 271 | |
| 272 | void JSInspectorFrontendHost::destroy(JSC::JSCell* cell) |
| 273 | { |
| 274 | JSInspectorFrontendHost* thisObject = static_cast<JSInspectorFrontendHost*>(cell); |
| 275 | thisObject->JSInspectorFrontendHost::~JSInspectorFrontendHost(); |
| 276 | } |
| 277 | |
| 278 | template<> inline JSInspectorFrontendHost* IDLAttribute<JSInspectorFrontendHost>::cast(ExecState& state, EncodedJSValue thisValue) |
| 279 | { |
| 280 | return jsDynamicCast<JSInspectorFrontendHost*>(state.vm(), JSValue::decode(thisValue)); |
| 281 | } |
| 282 | |
| 283 | template<> inline JSInspectorFrontendHost* IDLOperation<JSInspectorFrontendHost>::cast(ExecState& state) |
| 284 | { |
| 285 | return jsDynamicCast<JSInspectorFrontendHost*>(state.vm(), state.thisValue()); |
| 286 | } |
| 287 | |
| 288 | static 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 | |
| 297 | EncodedJSValue jsInspectorFrontendHostSupportsShowCertificate(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 298 | { |
| 299 | return IDLAttribute<JSInspectorFrontendHost>::get<jsInspectorFrontendHostSupportsShowCertificateGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "supportsShowCertificate" ); |
| 300 | } |
| 301 | |
| 302 | static 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 | |
| 311 | EncodedJSValue jsInspectorFrontendHostIsRemote(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 312 | { |
| 313 | return IDLAttribute<JSInspectorFrontendHost>::get<jsInspectorFrontendHostIsRemoteGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "isRemote" ); |
| 314 | } |
| 315 | |
| 316 | static 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 | |
| 325 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionLoaded(ExecState* state) |
| 326 | { |
| 327 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionLoadedBody>(*state, "loaded" ); |
| 328 | } |
| 329 | |
| 330 | static 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 | |
| 339 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCloseWindow(ExecState* state) |
| 340 | { |
| 341 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionCloseWindowBody>(*state, "closeWindow" ); |
| 342 | } |
| 343 | |
| 344 | static 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 | |
| 353 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionReopen(ExecState* state) |
| 354 | { |
| 355 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionReopenBody>(*state, "reopen" ); |
| 356 | } |
| 357 | |
| 358 | static 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 | |
| 367 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBringToFront(ExecState* state) |
| 368 | { |
| 369 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionBringToFrontBody>(*state, "bringToFront" ); |
| 370 | } |
| 371 | |
| 372 | static 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 | |
| 385 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionInspectedURLChanged(ExecState* state) |
| 386 | { |
| 387 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionInspectedURLChangedBody>(*state, "inspectedURLChanged" ); |
| 388 | } |
| 389 | |
| 390 | static 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 | |
| 402 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionShowCertificate(ExecState* state) |
| 403 | { |
| 404 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionShowCertificateBody>(*state, "showCertificate" ); |
| 405 | } |
| 406 | |
| 407 | static 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 | |
| 420 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetZoomFactor(ExecState* state) |
| 421 | { |
| 422 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionSetZoomFactorBody>(*state, "setZoomFactor" ); |
| 423 | } |
| 424 | |
| 425 | static 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 | |
| 433 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionZoomFactor(ExecState* state) |
| 434 | { |
| 435 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionZoomFactorBody>(*state, "zoomFactor" ); |
| 436 | } |
| 437 | |
| 438 | static 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 | |
| 446 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionUserInterfaceLayoutDirection(ExecState* state) |
| 447 | { |
| 448 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionUserInterfaceLayoutDirectionBody>(*state, "userInterfaceLayoutDirection" ); |
| 449 | } |
| 450 | |
| 451 | static 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 | |
| 464 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionRequestSetDockSide(ExecState* state) |
| 465 | { |
| 466 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionRequestSetDockSideBody>(*state, "requestSetDockSide" ); |
| 467 | } |
| 468 | |
| 469 | static 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 | |
| 482 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowHeight(ExecState* state) |
| 483 | { |
| 484 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowHeightBody>(*state, "setAttachedWindowHeight" ); |
| 485 | } |
| 486 | |
| 487 | static 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 | |
| 500 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowWidth(ExecState* state) |
| 501 | { |
| 502 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionSetAttachedWindowWidthBody>(*state, "setAttachedWindowWidth" ); |
| 503 | } |
| 504 | |
| 505 | static 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 | |
| 524 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSetSheetRect(ExecState* state) |
| 525 | { |
| 526 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionSetSheetRectBody>(*state, "setSheetRect" ); |
| 527 | } |
| 528 | |
| 529 | static 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 | |
| 538 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionStartWindowDrag(ExecState* state) |
| 539 | { |
| 540 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionStartWindowDragBody>(*state, "startWindowDrag" ); |
| 541 | } |
| 542 | |
| 543 | static 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 | |
| 558 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionMoveWindowBy(ExecState* state) |
| 559 | { |
| 560 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionMoveWindowByBody>(*state, "moveWindowBy" ); |
| 561 | } |
| 562 | |
| 563 | static 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 | |
| 571 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionLocalizedStringsURL(ExecState* state) |
| 572 | { |
| 573 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionLocalizedStringsURLBody>(*state, "localizedStringsURL" ); |
| 574 | } |
| 575 | |
| 576 | static 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 | |
| 584 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBackendCommandsURL(ExecState* state) |
| 585 | { |
| 586 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionBackendCommandsURLBody>(*state, "backendCommandsURL" ); |
| 587 | } |
| 588 | |
| 589 | static 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 | |
| 597 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionDebuggableType(ExecState* state) |
| 598 | { |
| 599 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionDebuggableTypeBody>(*state, "debuggableType" ); |
| 600 | } |
| 601 | |
| 602 | static 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 | |
| 610 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionInspectionLevel(ExecState* state) |
| 611 | { |
| 612 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionInspectionLevelBody>(*state, "inspectionLevel" ); |
| 613 | } |
| 614 | |
| 615 | static 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 | |
| 628 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCopyText(ExecState* state) |
| 629 | { |
| 630 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionCopyTextBody>(*state, "copyText" ); |
| 631 | } |
| 632 | |
| 633 | static 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 | |
| 650 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionKillText(ExecState* state) |
| 651 | { |
| 652 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionKillTextBody>(*state, "killText" ); |
| 653 | } |
| 654 | |
| 655 | static 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 | |
| 668 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionOpenInNewTab(ExecState* state) |
| 669 | { |
| 670 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionOpenInNewTabBody>(*state, "openInNewTab" ); |
| 671 | } |
| 672 | |
| 673 | static 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 | |
| 681 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionCanSave(ExecState* state) |
| 682 | { |
| 683 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionCanSaveBody>(*state, "canSave" ); |
| 684 | } |
| 685 | |
| 686 | static 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 | |
| 705 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSave(ExecState* state) |
| 706 | { |
| 707 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionSaveBody>(*state, "save" ); |
| 708 | } |
| 709 | |
| 710 | static 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 | |
| 725 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionAppend(ExecState* state) |
| 726 | { |
| 727 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionAppendBody>(*state, "append" ); |
| 728 | } |
| 729 | |
| 730 | static 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 | |
| 743 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionClose(ExecState* state) |
| 744 | { |
| 745 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionCloseBody>(*state, "close" ); |
| 746 | } |
| 747 | |
| 748 | static 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 | |
| 756 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionPlatform(ExecState* state) |
| 757 | { |
| 758 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionPlatformBody>(*state, "platform" ); |
| 759 | } |
| 760 | |
| 761 | static 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 | |
| 769 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionPort(ExecState* state) |
| 770 | { |
| 771 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionPortBody>(*state, "port" ); |
| 772 | } |
| 773 | |
| 774 | static 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 | |
| 789 | EncodedJSValue JSC_HOST_CALL (ExecState* state) |
| 790 | { |
| 791 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionShowContextMenuBody>(*state, "showContextMenu" ); |
| 792 | } |
| 793 | |
| 794 | static 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 | |
| 807 | EncodedJSValue JSC_HOST_CALL (ExecState* state) |
| 808 | { |
| 809 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionDispatchEventAsContextMenuEventBody>(*state, "dispatchEventAsContextMenuEvent" ); |
| 810 | } |
| 811 | |
| 812 | static 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 | |
| 825 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionSendMessageToBackend(ExecState* state) |
| 826 | { |
| 827 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionSendMessageToBackendBody>(*state, "sendMessageToBackend" ); |
| 828 | } |
| 829 | |
| 830 | static 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 | |
| 843 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionUnbufferedLog(ExecState* state) |
| 844 | { |
| 845 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionUnbufferedLogBody>(*state, "unbufferedLog" ); |
| 846 | } |
| 847 | |
| 848 | static 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 | |
| 856 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionIsUnderTest(ExecState* state) |
| 857 | { |
| 858 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionIsUnderTestBody>(*state, "isUnderTest" ); |
| 859 | } |
| 860 | |
| 861 | static 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 | |
| 870 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionBeep(ExecState* state) |
| 871 | { |
| 872 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionBeepBody>(*state, "beep" ); |
| 873 | } |
| 874 | |
| 875 | static 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 | |
| 884 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionInspectInspector(ExecState* state) |
| 885 | { |
| 886 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionInspectInspectorBody>(*state, "inspectInspector" ); |
| 887 | } |
| 888 | |
| 889 | static 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 | |
| 897 | EncodedJSValue JSC_HOST_CALL jsInspectorFrontendHostPrototypeFunctionIsBeingInspected(ExecState* state) |
| 898 | { |
| 899 | return IDLOperation<JSInspectorFrontendHost>::call<jsInspectorFrontendHostPrototypeFunctionIsBeingInspectedBody>(*state, "isBeingInspected" ); |
| 900 | } |
| 901 | |
| 902 | void 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 | |
| 911 | bool 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 | |
| 919 | void 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 | |
| 926 | JSC::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 | |
| 936 | JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, InspectorFrontendHost& impl) |
| 937 | { |
| 938 | return wrap(state, globalObject, impl); |
| 939 | } |
| 940 | |
| 941 | InspectorFrontendHost* 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 | |