mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
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:
parent
4873e2bb53
commit
8d574c7363
Notes:
sideshowbarker
2024-07-19 02:43:41 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/8d574c73639
1 changed files with 0 additions and 42 deletions
|
@ -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 };
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue