Revert "LibIPC+LibWeb: Delete LargeMessageWrapper workaround in IPC…

…connection"

This reverts commit 2d625f5c23.
This commit is contained in:
Tim Ledbetter 2025-04-10 12:49:50 +01:00 committed by Tim Ledbetter
commit 1ee56d34e7
Notes: github-actions[bot] 2025-04-10 15:25:37 +00:00
11 changed files with 177 additions and 23 deletions

View file

@ -9,6 +9,7 @@
#include <AK/Queue.h>
#include <LibCore/Socket.h>
#include <LibIPC/UnprocessedFileDescriptors.h>
#include <LibThreading/ConditionVariable.h>
#include <LibThreading/MutexProtected.h>
#include <LibThreading/Thread.h>
@ -65,9 +66,9 @@ public:
};
struct Message {
Vector<u8> bytes;
Queue<File> fds;
Vector<File> fds;
};
ShouldShutdown read_as_many_messages_as_possible_without_blocking(Function<void(Message&&)>&& schedule_shutdown);
ShouldShutdown read_as_many_messages_as_possible_without_blocking(Function<void(Message)>&& schedule_shutdown);
// Obnoxious name to make it clear that this is a dangerous operation.
ErrorOr<int> release_underlying_transport_for_transfer();
@ -79,7 +80,7 @@ private:
NonnullOwnPtr<Core::LocalSocket> m_socket;
ByteBuffer m_unprocessed_bytes;
Queue<File> m_unprocessed_fds;
UnprocessedFileDescriptors m_unprocessed_fds;
// After file descriptor is sent, it is moved to the wait queue until an acknowledgement is received from the peer.
// This is necessary to handle a specific behavior of the macOS kernel, which may prematurely garbage-collect the file