LibIPC+Everywhere: Always pass ownership of transferred data to clients

This has been a longstanding ergonomic issue with our IPC compiler. Non-
trivial types were previously passed by const&. So if we wanted to avoid
expensive copies, we would have to const_cast and move the data.

We now pass ownership of all transferred data to the client subclasses.
This allows us to remove const_cast from these methods, and allows us to
avoid some trivial expensive copies that we didn't bother to const_cast.
This commit is contained in:
Timothy Flynn 2025-03-08 12:22:39 -05:00 committed by Tim Flynn
parent 0f05aac290
commit cf69f52d53
Notes: github-actions[bot] 2025-03-09 15:15:22 +00:00
23 changed files with 395 additions and 399 deletions

View file

@ -40,7 +40,7 @@ private:
explicit ConnectionFromClient(IPC::Transport);
virtual Messages::ImageDecoderServer::DecodeImageResponse decode_image(Core::AnonymousBuffer const&, Optional<Gfx::IntSize> const& ideal_size, Optional<ByteString> const& mime_type) override;
virtual Messages::ImageDecoderServer::DecodeImageResponse decode_image(Core::AnonymousBuffer, Optional<Gfx::IntSize> ideal_size, Optional<ByteString> mime_type) override;
virtual void cancel_decoding(i64 image_id) override;
virtual Messages::ImageDecoderServer::ConnectNewClientsResponse connect_new_clients(size_t count) override;
virtual Messages::ImageDecoderServer::InitTransportResponse init_transport(int peer_pid) override;