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(). :^)
This commit is contained in:
Andreas Kling 2020-09-12 13:04:43 +02:00
parent 4873e2bb53
commit 8d574c7363
Notes: sideshowbarker 2024-07-19 02:43:41 +09:00

View file

@ -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<typename T, class... Args>
NonnullRefPtr<T> 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<const DisconnectedEvent&>(event).client_id();
dbg() << *this << ": Client disconnected: " << client_id;
#endif
this->die();
return;
}
Core::Object::event(event);
}
private:
int m_client_id { -1 };
};