1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 19:15:09 +00:00

LibWeb: Move unsafe_shared_current_time() to HighResolutionTime

This doesn't belong on the EventLoop at all, as far as I can tell.
This commit is contained in:
Linus Groh 2022-10-04 21:25:00 +01:00
parent ff9a80f54f
commit 4ea6cc56be
10 changed files with 31 additions and 25 deletions

View file

@ -43,6 +43,7 @@
#include <LibWeb/HTML/Storage.h>
#include <LibWeb/HTML/Timer.h>
#include <LibWeb/HTML/Window.h>
#include <LibWeb/HighResolutionTime/CoarsenTime.h>
#include <LibWeb/HighResolutionTime/Performance.h>
#include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Page/Page.h>
@ -652,7 +653,7 @@ void Window::invoke_idle_callbacks()
auto& event_loop = main_thread_event_loop();
// 1. If the user-agent believes it should end the idle period early due to newly scheduled high-priority work, return from the algorithm.
// 2. Let now be the current time.
auto now = event_loop.unsafe_shared_current_time();
auto now = HighResolutionTime::unsafe_shared_current_time();
// 3. If now is less than the result of calling getDeadline and the window's list of runnable idle callbacks is not empty:
if (now < event_loop.compute_deadline() && !m_runnable_idle_callbacks.is_empty()) {
// 1. Pop the top callback from window's list of runnable idle callbacks.