mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-18 23:12:02 +00:00
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:
parent
0f05aac290
commit
cf69f52d53
Notes:
github-actions[bot]
2025-03-09 15:15:22 +00:00
Author: https://github.com/trflynn89
Commit: cf69f52d53
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3865
23 changed files with 395 additions and 399 deletions
|
@ -160,7 +160,7 @@ NonnullRefPtr<ConnectionFromClient::Job> ConnectionFromClient::make_decode_image
|
|||
});
|
||||
}
|
||||
|
||||
Messages::ImageDecoderServer::DecodeImageResponse ConnectionFromClient::decode_image(Core::AnonymousBuffer const& encoded_buffer, Optional<Gfx::IntSize> const& ideal_size, Optional<ByteString> const& mime_type)
|
||||
Messages::ImageDecoderServer::DecodeImageResponse ConnectionFromClient::decode_image(Core::AnonymousBuffer encoded_buffer, Optional<Gfx::IntSize> ideal_size, Optional<ByteString> mime_type)
|
||||
{
|
||||
auto image_id = m_next_image_id++;
|
||||
|
||||
|
@ -170,7 +170,7 @@ Messages::ImageDecoderServer::DecodeImageResponse ConnectionFromClient::decode_i
|
|||
return image_id;
|
||||
}
|
||||
|
||||
m_pending_jobs.set(image_id, make_decode_image_job(image_id, encoded_buffer, ideal_size, mime_type));
|
||||
m_pending_jobs.set(image_id, make_decode_image_job(image_id, move(encoded_buffer), ideal_size, move(mime_type)));
|
||||
|
||||
return image_id;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue