Everywhere: Make TransportSocket non-movable

Instead of wrapping all non-movable members of TransportSocket in OwnPtr
to keep it movable, make TransportSocket itself non-movable and wrap it
in OwnPtr.
This commit is contained in:
Aliaksandr Kalenik 2025-04-08 22:01:46 +02:00 committed by Alexander Kalenik
parent 79c22e0d86
commit db8c443392
Notes: github-actions[bot] 2025-04-09 13:28:53 +00:00
42 changed files with 97 additions and 100 deletions

View file

@ -17,7 +17,7 @@ namespace ImageDecoder {
static HashMap<int, RefPtr<ConnectionFromClient>> s_connections;
static IDAllocator s_client_ids;
ConnectionFromClient::ConnectionFromClient(IPC::Transport transport)
ConnectionFromClient::ConnectionFromClient(NonnullOwnPtr<IPC::Transport> transport)
: IPC::ConnectionFromClient<ImageDecoderClientEndpoint, ImageDecoderServerEndpoint>(*this, move(transport), s_client_ids.allocate())
{
s_connections.set(client_id(), *this);
@ -64,7 +64,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(IPC::Transport(move(client_socket))));
auto client = adopt_ref(*new ConnectionFromClient(make<IPC::Transport>(move(client_socket))));
return IPC::File::adopt_fd(socket_fds[1]);
}