From d2ae37f88f71a0bd234176e0c9bed0570376e85c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 19 May 2020 17:40:44 +0200 Subject: [PATCH] LibProtocol: Make Protocol::Client constructor private Core::Object derived objects should always have private constructors and use construct() for construction. This prevents accidentally keeping them in non-reference-counting containers. --- Libraries/LibProtocol/Client.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Libraries/LibProtocol/Client.h b/Libraries/LibProtocol/Client.h index eb51ac716d..e8014cb289 100644 --- a/Libraries/LibProtocol/Client.h +++ b/Libraries/LibProtocol/Client.h @@ -35,12 +35,12 @@ namespace Protocol { class Download; -class Client : public IPC::ServerConnection +class Client + : public IPC::ServerConnection , public ProtocolClientEndpoint { - C_OBJECT(Client) -public: - Client(); + C_OBJECT(Client); +public: virtual void handshake() override; bool is_supported_protocol(const String&); @@ -49,6 +49,8 @@ public: bool stop_download(Badge, Download&); private: + Client(); + virtual void handle(const Messages::ProtocolClient::DownloadProgress&) override; virtual void handle(const Messages::ProtocolClient::DownloadFinished&) override;