1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibCore+Ladybird: Don't force timer ids to be integer just to remap them

If we don't force event loop to fit timer id into integer, we can
eliminate awkward IDAllocator inside EventLoopImplementations.
This commit is contained in:
Dan Klishch 2024-02-18 00:11:38 -05:00 committed by Andrew Kaster
parent bed4af6fef
commit b77996884e
10 changed files with 36 additions and 46 deletions

View file

@ -125,12 +125,12 @@ void EventLoop::notify_forked(ForkEvent)
current().m_impl->notify_forked_and_in_child();
}
int EventLoop::register_timer(EventReceiver& object, int milliseconds, bool should_reload, TimerShouldFireWhenNotVisible fire_when_not_visible)
intptr_t EventLoop::register_timer(EventReceiver& object, int milliseconds, bool should_reload, TimerShouldFireWhenNotVisible fire_when_not_visible)
{
return EventLoopManager::the().register_timer(object, milliseconds, should_reload, fire_when_not_visible);
}
void EventLoop::unregister_timer(int timer_id)
void EventLoop::unregister_timer(intptr_t timer_id)
{
EventLoopManager::the().unregister_timer(timer_id);
}