mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
34160743dc
For every IPC message sent, we currently prepend the message size to the IPC message buffer. This incurs the cost of copying the entire message to its newly allocated position. Instead, reserve the bytes for the size at the front of the buffer upon creation. Prevent dangerous access to the buffer with specific public methods.
27 lines
374 B
C++
27 lines
374 B
C++
/*
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Error.h>
|
|
|
|
namespace IPC {
|
|
|
|
class Decoder;
|
|
class Encoder;
|
|
class Message;
|
|
class MessageBuffer;
|
|
class File;
|
|
class Stub;
|
|
|
|
template<typename T>
|
|
ErrorOr<void> encode(Encoder&, T const&);
|
|
|
|
template<typename T>
|
|
ErrorOr<T> decode(Decoder&);
|
|
|
|
}
|