summaryrefslogtreecommitdiff
path: root/Services/ImageDecoder
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-09-12 11:44:00 +0200
committerAndreas Kling <kling@serenityos.org>2020-09-12 14:49:29 +0200
commitaba793fb3e1096cd05867cb9217226f93975e33f (patch)
treefa29878a96f7d5de54297283e1752dfeac635061 /Services/ImageDecoder
parent633e0bc9443aaa248fcc7faa583304ae5215755f (diff)
downloadserenity-aba793fb3e1096cd05867cb9217226f93975e33f.zip
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.
Diffstat (limited to 'Services/ImageDecoder')
-rw-r--r--Services/ImageDecoder/ClientConnection.cpp2
-rw-r--r--Services/ImageDecoder/ClientConnection.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/Services/ImageDecoder/ClientConnection.cpp b/Services/ImageDecoder/ClientConnection.cpp
index cea63ce8d9..42df7eb0bc 100644
--- a/Services/ImageDecoder/ClientConnection.cpp
+++ b/Services/ImageDecoder/ClientConnection.cpp
@@ -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);
}
diff --git a/Services/ImageDecoder/ClientConnection.h b/Services/ImageDecoder/ClientConnection.h
index 2021d73682..1447c3b063 100644
--- a/Services/ImageDecoder/ClientConnection.h
+++ b/Services/ImageDecoder/ClientConnection.h
@@ -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);