mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:17:46 +00:00
Userland: Get rid of the OwnPtr<...> boilerplate code for IPC handlers
This commit is contained in:
parent
1a015dc379
commit
7cf2839a26
33 changed files with 389 additions and 385 deletions
|
@ -48,13 +48,18 @@ public:
|
|||
}
|
||||
|
||||
void post_message(const Message& message)
|
||||
{
|
||||
post_message(message.encode());
|
||||
}
|
||||
|
||||
// FIXME: unnecessary copy
|
||||
void post_message(MessageBuffer buffer)
|
||||
{
|
||||
// NOTE: If this connection is being shut down, but has not yet been destroyed,
|
||||
// the socket will be closed. Don't try to send more messages.
|
||||
if (!m_socket->is_open())
|
||||
return;
|
||||
|
||||
auto buffer = message.encode();
|
||||
// Prepend the message size.
|
||||
uint32_t message_size = buffer.data.size();
|
||||
buffer.data.prepend(reinterpret_cast<const u8*>(&message_size), sizeof(message_size));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue