diff options
author | Andreas Kling <kling@serenityos.org> | 2020-05-19 17:40:44 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-19 17:46:28 +0200 |
commit | d2ae37f88f71a0bd234176e0c9bed0570376e85c (patch) | |
tree | 502daab82a3fb66f6ec8edb5951c77a1a04d5412 | |
parent | bc7bf727dda40d34970232af6e5b01d2bb5673ec (diff) | |
download | serenity-d2ae37f88f71a0bd234176e0c9bed0570376e85c.zip |
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.
-rw-r--r-- | Libraries/LibProtocol/Client.h | 10 |
1 files 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<ProtocolClientEndpoint, ProtocolServerEndpoint> +class Client + : public IPC::ServerConnection<ProtocolClientEndpoint, ProtocolServerEndpoint> , 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>, Download&); private: + Client(); + virtual void handle(const Messages::ProtocolClient::DownloadProgress&) override; virtual void handle(const Messages::ProtocolClient::DownloadFinished&) override; |