From d2b2d3ad8062d2ce1612f24e4c45d533344a2be3 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Mon, 14 Nov 2022 10:42:45 -0500 Subject: [PATCH] WebContent: Allow creating a WebDriverConnection with an existing socket The socket used by WebDriverConnection will be created separately for Ladybird. --- Userland/Services/WebContent/WebDriverConnection.cpp | 2 +- Userland/Services/WebContent/WebDriverConnection.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Services/WebContent/WebDriverConnection.cpp b/Userland/Services/WebContent/WebDriverConnection.cpp index f0f3f10dc3..0bfa776900 100644 --- a/Userland/Services/WebContent/WebDriverConnection.cpp +++ b/Userland/Services/WebContent/WebDriverConnection.cpp @@ -209,7 +209,7 @@ ErrorOr> WebDriverConnection::connect(Connect auto socket = TRY(Core::Stream::LocalSocket::connect(webdriver_ipc_path)); dbgln_if(WEBDRIVER_DEBUG, "Connected to WebDriver"); - return adopt_nonnull_ref_or_enomem(new (nothrow) WebDriverConnection(move(socket), web_content_client, page_host)); + return try_create(move(socket), web_content_client, page_host); } WebDriverConnection::WebDriverConnection(NonnullOwnPtr socket, ConnectionFromClient& web_content_client, PageHost& page_host) diff --git a/Userland/Services/WebContent/WebDriverConnection.h b/Userland/Services/WebContent/WebDriverConnection.h index 91893bf24c..dbea45c7bc 100644 --- a/Userland/Services/WebContent/WebDriverConnection.h +++ b/Userland/Services/WebContent/WebDriverConnection.h @@ -23,7 +23,7 @@ namespace WebContent { class WebDriverConnection final : public IPC::ConnectionToServer { - C_OBJECT_ABSTRACT(WebDriverConnection) + C_OBJECT(WebDriverConnection) public: static ErrorOr> connect(ConnectionFromClient& web_content_client, PageHost& page_host, String const& webdriver_ipc_path);