1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:37:36 +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

@ -7,6 +7,7 @@
#include <LibWeb/HTML/EventLoop/EventLoop.h>
#include <LibWeb/HTML/Window.h>
#include <LibWeb/HighResolutionTime/CoarsenTime.h>
#include <LibWeb/RequestIdleCallback/IdleDeadline.h>
namespace Web::RequestIdleCallback {
@ -30,7 +31,7 @@ double IdleDeadline::time_remaining() const
{
auto const& event_loop = HTML::main_thread_event_loop();
// 1. Let now be a DOMHighResTimeStamp representing current high resolution time in milliseconds.
auto now = event_loop.unsafe_shared_current_time();
auto now = HighResolutionTime::unsafe_shared_current_time();
// 2. Let deadline be the result of calling IdleDeadline's get deadline time algorithm.
auto deadline = event_loop.compute_deadline();
// 3. Let timeRemaining be deadline - now.