mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 04:22:28 +00:00
LibWeb: Use Core::Timer in AnimationFrameCallbackDriver
There was no need to use a Platform::Timer here since we're not making use of the automatic SafeFunction behavior anyway.
This commit is contained in:
parent
518cedc8f3
commit
32d065011b
Notes:
sideshowbarker
2024-07-17 07:19:27 +09:00
Author: https://github.com/awesomekling
Commit: 32d065011b
Pull-request: https://github.com/SerenityOS/serenity/pull/23815
Reviewed-by: https://github.com/ADKaster
1 changed files with 4 additions and 4 deletions
|
@ -9,8 +9,8 @@
|
||||||
#include <AK/Function.h>
|
#include <AK/Function.h>
|
||||||
#include <AK/HashMap.h>
|
#include <AK/HashMap.h>
|
||||||
#include <AK/IDAllocator.h>
|
#include <AK/IDAllocator.h>
|
||||||
|
#include <LibCore/Timer.h>
|
||||||
#include <LibWeb/HTML/EventLoop/EventLoop.h>
|
#include <LibWeb/HTML/EventLoop/EventLoop.h>
|
||||||
#include <LibWeb/Platform/Timer.h>
|
|
||||||
|
|
||||||
namespace Web::HTML {
|
namespace Web::HTML {
|
||||||
|
|
||||||
|
@ -19,9 +19,9 @@ struct AnimationFrameCallbackDriver {
|
||||||
|
|
||||||
AnimationFrameCallbackDriver()
|
AnimationFrameCallbackDriver()
|
||||||
{
|
{
|
||||||
m_timer = Platform::Timer::create_single_shot(16, [] {
|
m_timer = MUST(Core::Timer::create_single_shot(16, [] {
|
||||||
HTML::main_thread_event_loop().schedule();
|
HTML::main_thread_event_loop().schedule();
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
i32 add(Callback handler)
|
i32 add(Callback handler)
|
||||||
|
@ -58,7 +58,7 @@ struct AnimationFrameCallbackDriver {
|
||||||
private:
|
private:
|
||||||
OrderedHashMap<i32, Callback> m_callbacks;
|
OrderedHashMap<i32, Callback> m_callbacks;
|
||||||
IDAllocator m_id_allocator;
|
IDAllocator m_id_allocator;
|
||||||
RefPtr<Platform::Timer> m_timer;
|
RefPtr<Core::Timer> m_timer;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue