/* * Copyright (c) 2022, Florent Castelli * Copyright (c) 2022, Linus Groh * Copyright (c) 2022, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include namespace WebContent { class WebDriverConnection final : public IPC::ConnectionToServer { C_OBJECT_ABSTRACT(WebDriverConnection) public: static ErrorOr> connect(PageHost& page_host, String const& webdriver_ipc_path); virtual ~WebDriverConnection() = default; private: WebDriverConnection(NonnullOwnPtr socket, PageHost& page_host); virtual void die() override { } virtual void close_session() override; virtual void set_is_webdriver_active(bool) override; virtual Messages::WebDriverClient::NavigateToResponse navigate_to(JsonValue const& payload) override; virtual Messages::WebDriverClient::GetCurrentUrlResponse get_current_url() override; ErrorOr ensure_open_top_level_browsing_context(); PageHost& m_page_host; }; }