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:
Andreas Kling 2024-04-03 12:48:45 +02:00
commit 32d065011b
Notes: sideshowbarker 2024-07-17 07:19:27 +09:00

View file

@ -9,8 +9,8 @@
#include <AK/Function.h>
#include <AK/HashMap.h>
#include <AK/IDAllocator.h>
#include <LibCore/Timer.h>
#include <LibWeb/HTML/EventLoop/EventLoop.h>
#include <LibWeb/Platform/Timer.h>
namespace Web::HTML {
@ -19,9 +19,9 @@ struct 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();
});
}));
}
i32 add(Callback handler)
@ -58,7 +58,7 @@ struct AnimationFrameCallbackDriver {
private:
OrderedHashMap<i32, Callback> m_callbacks;
IDAllocator m_id_allocator;
RefPtr<Platform::Timer> m_timer;
RefPtr<Core::Timer> m_timer;
};
}