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
|
@ -35,10 +35,14 @@ void WorkerAgent::initialize(JS::Realm& realm)
|
|||
// NOTE: This blocking IPC call may launch another process.
|
||||
// If spinning the event loop for this can cause other javascript to execute, we're in trouble.
|
||||
auto worker_socket_file = Bindings::host_defined_page(realm).client().request_worker_agent();
|
||||
|
||||
auto worker_socket = MUST(Core::LocalSocket::adopt_fd(worker_socket_file.take_fd()));
|
||||
MUST(worker_socket->set_blocking(true));
|
||||
static_assert(IsSame<IPC::Transport, IPC::TransportSocket>, "Handle other IPC::Transport types here");
|
||||
|
||||
m_worker_ipc = make_ref_counted<WebWorkerClient>(move(worker_socket));
|
||||
auto transport = IPC::Transport(move(worker_socket));
|
||||
|
||||
m_worker_ipc = make_ref_counted<WebWorkerClient>(move(transport));
|
||||
|
||||
m_worker_ipc->async_start_dedicated_worker(m_url, m_worker_options.type, m_worker_options.credentials, m_worker_options.name, move(data_holder), m_outside_settings->serialize());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue