mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +00:00
LibWeb: Remove assertions about type of IPC::Transport
These constexpr checks and static assertions are really just loud FIXME comments, and should be comments instead.
This commit is contained in:
parent
fe43712e72
commit
2be8052f0a
Notes:
github-actions[bot]
2025-02-13 01:43:06 +00:00
Author: https://github.com/stasoid
Commit: 2be8052f0a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3000
Reviewed-by: https://github.com/ADKaster ✅
2 changed files with 12 additions and 18 deletions
|
@ -100,14 +100,11 @@ WebIDL::ExceptionOr<void> MessagePort::transfer_steps(HTML::TransferDataHolder&
|
|||
m_remote_port->m_has_been_shipped = true;
|
||||
|
||||
// 2. Set dataHolder.[[RemotePort]] to remotePort.
|
||||
if constexpr (IsSame<IPC::Transport, IPC::TransportSocket>) {
|
||||
auto fd = MUST(m_transport->release_underlying_transport_for_transfer());
|
||||
m_transport = {};
|
||||
data_holder.fds.append(IPC::File::adopt_fd(fd));
|
||||
data_holder.data.append(IPC_FILE_TAG);
|
||||
} else {
|
||||
VERIFY(false && "Don't know how to transfer IPC::Transport type");
|
||||
}
|
||||
// TODO: Mach IPC
|
||||
auto fd = MUST(m_transport->release_underlying_transport_for_transfer());
|
||||
m_transport = {};
|
||||
data_holder.fds.append(IPC::File::adopt_fd(fd));
|
||||
data_holder.data.append(IPC_FILE_TAG);
|
||||
}
|
||||
|
||||
// 4. Otherwise, set dataHolder.[[RemotePort]] to null.
|
||||
|
@ -131,16 +128,13 @@ WebIDL::ExceptionOr<void> MessagePort::transfer_receiving_steps(HTML::TransferDa
|
|||
// (This will disentangle dataHolder.[[RemotePort]] from the original port that was transferred.)
|
||||
auto fd_tag = data_holder.data.take_first();
|
||||
if (fd_tag == IPC_FILE_TAG) {
|
||||
if constexpr (IsSame<IPC::Transport, IPC::TransportSocket>) {
|
||||
auto fd = data_holder.fds.take_first();
|
||||
m_transport = IPC::Transport(MUST(Core::LocalSocket::adopt_fd(fd.take_fd())));
|
||||
// TODO: Mach IPC
|
||||
auto fd = data_holder.fds.take_first();
|
||||
m_transport = IPC::Transport(MUST(Core::LocalSocket::adopt_fd(fd.take_fd())));
|
||||
|
||||
m_transport->set_up_read_hook([strong_this = GC::make_root(this)]() {
|
||||
strong_this->read_from_transport();
|
||||
});
|
||||
} else {
|
||||
VERIFY(false && "Don't know how to receive IPC::Transport type");
|
||||
}
|
||||
m_transport->set_up_read_hook([strong_this = GC::make_root(this)]() {
|
||||
strong_this->read_from_transport();
|
||||
});
|
||||
} else if (fd_tag != 0) {
|
||||
dbgln("Unexpected byte {:x} in MessagePort transfer data", fd_tag);
|
||||
VERIFY_NOT_REACHED();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue