1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

LibWeb: Use OrderedHashMap to store pending idle callbacks

This removes the need for a separate IdleCallback object per
registration, since the handles are now used as map keys.
This commit is contained in:
Andreas Kling 2022-10-20 13:26:35 +02:00
parent 8875cd0c83
commit dc15cacfc3
2 changed files with 18 additions and 35 deletions

View file

@ -161,9 +161,9 @@ private:
AnimationFrameCallbackDriver m_animation_frame_callback_driver;
// https://w3c.github.io/requestidlecallback/#dfn-list-of-idle-request-callbacks
NonnullRefPtrVector<IdleCallback> m_idle_request_callbacks;
OrderedHashMap<u32, JS::NonnullGCPtr<WebIDL::CallbackType>> m_idle_request_callbacks;
// https://w3c.github.io/requestidlecallback/#dfn-list-of-runnable-idle-callbacks
NonnullRefPtrVector<IdleCallback> m_runnable_idle_callbacks;
OrderedHashMap<u32, JS::NonnullGCPtr<WebIDL::CallbackType>> m_runnable_idle_callbacks;
// https://w3c.github.io/requestidlecallback/#dfn-idle-callback-identifier
u32 m_idle_callback_identifier = 0;