From 8d574c736397c645deb53b4997468acd069a45d3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 12 Sep 2020 13:04:43 +0200 Subject: [PATCH] LibIPC: Remove unused DisconnectedEvent mechanism This was previously used to defer handling disconnections until the next event loop iteration. We now achieve the same with simple use of deferred_invoke(). :^) --- Libraries/LibIPC/ClientConnection.h | 42 ----------------------------- 1 file changed, 42 deletions(-) diff --git a/Libraries/LibIPC/ClientConnection.h b/Libraries/LibIPC/ClientConnection.h index e82eed702e..a970ebec0e 100644 --- a/Libraries/LibIPC/ClientConnection.h +++ b/Libraries/LibIPC/ClientConnection.h @@ -30,33 +30,6 @@ namespace IPC { -class Event : public Core::Event { -public: - enum Type { - Invalid = 2000, - Disconnected, - }; - Event() { } - explicit Event(Type type) - : Core::Event(type) - { - } -}; - -class DisconnectedEvent : public Event { -public: - explicit DisconnectedEvent(int client_id) - : Event(Disconnected) - , m_client_id(client_id) - { - } - - int client_id() const { return m_client_id; } - -private: - int m_client_id { 0 }; -}; - template NonnullRefPtr new_client_connection(Args&&... args) { @@ -98,21 +71,6 @@ public: virtual void die() = 0; -protected: - void event(Core::Event& event) override - { - if (event.type() == Event::Disconnected) { -#ifdef IPC_DEBUG - int client_id = static_cast(event).client_id(); - dbg() << *this << ": Client disconnected: " << client_id; -#endif - this->die(); - return; - } - - Core::Object::event(event); - } - private: int m_client_id { -1 }; };