mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
LibIPC: Move send thread from IPC connection to the transport layer
By doing this we also make MessagePort, that relies on IPC transport, to send messages from separate thread, which solves the problem when WebWorker and WebContent could deadlock if both were trying to post messages at the same time. Fixes https://github.com/LadybirdBrowser/ladybird/issues/4254
This commit is contained in:
parent
af2dae63d1
commit
14bac7b287
Notes:
github-actions[bot]
2025-04-08 19:10:29 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 14bac7b287
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4276
Reviewed-by: https://github.com/ADKaster
6 changed files with 118 additions and 111 deletions
|
@ -43,16 +43,7 @@ ErrorOr<void> MessageBuffer::transfer_message(Transport& transport)
|
|||
return Error::from_string_literal("Message is too large for IPC encoding");
|
||||
}
|
||||
|
||||
auto raw_fds = Vector<int, 1> {};
|
||||
auto num_fds_to_transfer = m_fds.size();
|
||||
if (num_fds_to_transfer > 0) {
|
||||
raw_fds.ensure_capacity(num_fds_to_transfer);
|
||||
for (auto& owned_fd : m_fds) {
|
||||
raw_fds.unchecked_append(owned_fd->value());
|
||||
}
|
||||
}
|
||||
|
||||
TRY(transport.transfer_message(m_data.span(), raw_fds));
|
||||
transport.post_message(m_data, m_fds);
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue