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.
This commit is contained in:
Andreas Kling 2020-05-19 17:40:44 +02:00
parent bc7bf727dd
commit d2ae37f88f
Notes: sideshowbarker 2024-07-19 06:23:41 +09:00

View file

@ -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;