mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02:00
LibCore: Remove unused NotifierActivationEvent fd() and type() methods
In 11b8bbe one thing that was claimed was that we now properly set the
Notifier's actual fd on the NotifierActivationEvent. It turns out that
claim was false because a crucial step was forgotten: actually set the
m_notifier_fd when registering. Despite that mistake, it ultimately was
irrelevant as the methods on NotifierActivationEvent are currently
unused code. We were posting the event to the correct Notifier receiver
so the on_activation was still getting invoked.
Given they are unused, NotifierActivationEvent can be defined the same
way as TimerEvent is, where we just pass the event type enum to the
Event base class. Additionally, NotificationType can be moved to
the Notifier header as this enum is now always used in the context of
creating or using a Notifier instance.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
c34b5a544e
commit
4fb1ba0193
Notes:
github-actions[bot]
2025-11-22 08:48:51 +00:00
Author: https://github.com/ayeteadoe Commit: https://github.com/LadybirdBrowser/ladybird/commit/4fb1ba0193c Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6903 Reviewed-by: https://github.com/gmta ✅
@@ -96,13 +96,7 @@ struct EventLoopNotifier final : CompletionPacket {
|
||||
{
|
||||
}
|
||||
|
||||
Notifier::Type notifier_type() const { return m_notifier_type; }
|
||||
int notifier_fd() const { return m_notifier_fd; }
|
||||
|
||||
// These are a space tradeoff for avoiding a double indirection through the notifier*.
|
||||
Notifier* notifier;
|
||||
Notifier::Type m_notifier_type;
|
||||
int m_notifier_fd { -1 };
|
||||
OwnHandle wait_packet;
|
||||
OwnHandle wait_event;
|
||||
};
|
||||
@@ -211,7 +205,7 @@ size_t EventLoopImplementationWindows::pump(PumpMode pump_mode)
|
||||
}
|
||||
if (packet->type == CompletionType::Notifer) {
|
||||
auto* notifier_data = static_cast<EventLoopNotifier*>(packet);
|
||||
event_queue.post_event(*notifier_data->notifier, make<NotifierActivationEvent>(notifier_data->notifier_fd(), notifier_data->notifier_type()));
|
||||
event_queue.post_event(*notifier_data->notifier, make<NotifierActivationEvent>());
|
||||
NTSTATUS status = g_system.NtAssociateWaitCompletionPacket(notifier_data->wait_packet.handle, thread_data->iocp.handle, notifier_data->wait_event.handle, notifier_data, NULL, 0, 0, NULL);
|
||||
VERIFY(NT_SUCCESS(status));
|
||||
continue;
|
||||
@@ -279,7 +273,6 @@ void EventLoopManagerWindows::register_notifier(Notifier& notifier)
|
||||
auto notifier_data = make<EventLoopNotifier>();
|
||||
notifier_data->type = CompletionType::Notifer;
|
||||
notifier_data->notifier = ¬ifier;
|
||||
notifier_data->m_notifier_type = notifier.type();
|
||||
notifier_data->wait_event.handle = event;
|
||||
NTSTATUS status = g_system.NtCreateWaitCompletionPacket(¬ifier_data->wait_packet.handle, GENERIC_READ | GENERIC_WRITE, NULL);
|
||||
VERIFY(NT_SUCCESS(status));
|
||||
|
||||
Reference in New Issue
Block a user