mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-18 08:20:44 +00:00
LibIPC+Everywhere: Introduce an IPC Transport abstraction
This abstraction will help us to support multiple IPC transport mechanisms going forward. For now, we only have a TransportSocket that implements the same behavior we previously had, using Unix Sockets for IPC.
This commit is contained in:
parent
9a6eccc590
commit
7372b2af48
Notes:
github-actions[bot]
2024-10-23 19:14:14 +00:00
Author: https://github.com/ADKaster
Commit: 7372b2af48
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1925
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/trflynn89
45 changed files with 415 additions and 234 deletions
|
@ -184,6 +184,8 @@ static bool fire_an_event(FlyString name, Optional<Web::DOM::Element&> target)
|
|||
|
||||
ErrorOr<NonnullRefPtr<WebDriverConnection>> WebDriverConnection::connect(Web::PageClient& page_client, ByteString const& webdriver_ipc_path)
|
||||
{
|
||||
static_assert(IsSame<IPC::Transport, IPC::TransportSocket>, "Need to handle other IPC transports here");
|
||||
|
||||
dbgln_if(WEBDRIVER_DEBUG, "Trying to connect to {}", webdriver_ipc_path);
|
||||
auto socket = TRY(Core::LocalSocket::connect(webdriver_ipc_path));
|
||||
|
||||
|
@ -191,11 +193,11 @@ ErrorOr<NonnullRefPtr<WebDriverConnection>> WebDriverConnection::connect(Web::Pa
|
|||
page_client.page().set_should_block_pop_ups(false);
|
||||
|
||||
dbgln_if(WEBDRIVER_DEBUG, "Connected to WebDriver");
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) WebDriverConnection(move(socket), page_client));
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) WebDriverConnection(IPC::Transport(move(socket)), page_client));
|
||||
}
|
||||
|
||||
WebDriverConnection::WebDriverConnection(NonnullOwnPtr<Core::LocalSocket> socket, Web::PageClient& page_client)
|
||||
: IPC::ConnectionToServer<WebDriverClientEndpoint, WebDriverServerEndpoint>(*this, move(socket))
|
||||
WebDriverConnection::WebDriverConnection(IPC::Transport transport, Web::PageClient& page_client)
|
||||
: IPC::ConnectionToServer<WebDriverClientEndpoint, WebDriverServerEndpoint>(*this, move(transport))
|
||||
{
|
||||
set_current_top_level_browsing_context(page_client.page().top_level_browsing_context());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue