mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibIPC: Share most of the code between {Client,Server}Connection
This patch introduces IPC::Connection which becomes the new base class of ClientConnection and ServerConnection. Most of the functionality has been hoisted up to the base class since almost all of it is useful on both sides. This gives us the ability to send synchronous messages in both directions, which is needed for the WebContent server process. Unlike other servers, WebContent does not mind blocking on a response from its client.
This commit is contained in:
@@ -37,7 +37,7 @@ namespace ImageDecoder {
|
||||
static HashMap<int, RefPtr<ClientConnection>> s_connections;
|
||||
|
||||
ClientConnection::ClientConnection(NonnullRefPtr<Core::LocalSocket> socket, int client_id)
|
||||
: IPC::ClientConnection<ImageDecoderServerEndpoint>(*this, move(socket), client_id)
|
||||
: IPC::ClientConnection<ImageDecoderClientEndpoint, ImageDecoderServerEndpoint>(*this, move(socket), client_id)
|
||||
{
|
||||
s_connections.set(client_id, *this);
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
#include <AK/HashMap.h>
|
||||
#include <ImageDecoder/Forward.h>
|
||||
#include <ImageDecoder/ImageDecoderClientEndpoint.h>
|
||||
#include <ImageDecoder/ImageDecoderServerEndpoint.h>
|
||||
#include <LibIPC/ClientConnection.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
@@ -35,7 +36,7 @@
|
||||
namespace ImageDecoder {
|
||||
|
||||
class ClientConnection final
|
||||
: public IPC::ClientConnection<ImageDecoderServerEndpoint>
|
||||
: public IPC::ClientConnection<ImageDecoderClientEndpoint, ImageDecoderServerEndpoint>
|
||||
, public ImageDecoderServerEndpoint {
|
||||
C_OBJECT(ClientConnection);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user