mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +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
|
@ -17,8 +17,8 @@ namespace ImageDecoder {
|
|||
static HashMap<int, RefPtr<ConnectionFromClient>> s_connections;
|
||||
static IDAllocator s_client_ids;
|
||||
|
||||
ConnectionFromClient::ConnectionFromClient(NonnullOwnPtr<Core::LocalSocket> socket)
|
||||
: IPC::ConnectionFromClient<ImageDecoderClientEndpoint, ImageDecoderServerEndpoint>(*this, move(socket), s_client_ids.allocate())
|
||||
ConnectionFromClient::ConnectionFromClient(IPC::Transport transport)
|
||||
: IPC::ConnectionFromClient<ImageDecoderClientEndpoint, ImageDecoderServerEndpoint>(*this, move(transport), s_client_ids.allocate())
|
||||
{
|
||||
s_connections.set(client_id(), *this);
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ ErrorOr<IPC::File> ConnectionFromClient::connect_new_client()
|
|||
|
||||
auto client_socket = client_socket_or_error.release_value();
|
||||
// Note: A ref is stored in the static s_connections map
|
||||
auto client = adopt_ref(*new ConnectionFromClient(move(client_socket)));
|
||||
auto client = adopt_ref(*new ConnectionFromClient(IPC::Transport(move(client_socket))));
|
||||
|
||||
return IPC::File::adopt_fd(socket_fds[1]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue