mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 11:07:45 +00:00
LibWeb: Implement 'coarsened shared current time'
This commit is contained in:
parent
5c4eb90d65
commit
ff9a80f54f
2 changed files with 11 additions and 0 deletions
|
@ -1,9 +1,11 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
||||||
|
* Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <LibWeb/HTML/EventLoop/EventLoop.h>
|
||||||
#include <LibWeb/HighResolutionTime/CoarsenTime.h>
|
#include <LibWeb/HighResolutionTime/CoarsenTime.h>
|
||||||
|
|
||||||
namespace Web::HighResolutionTime {
|
namespace Web::HighResolutionTime {
|
||||||
|
@ -16,4 +18,11 @@ DOMHighResTimeStamp coarsen_time(DOMHighResTimeStamp timestamp, bool cross_origi
|
||||||
return timestamp;
|
return timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://w3c.github.io/hr-time/#dfn-coarsened-shared-current-time
|
||||||
|
DOMHighResTimeStamp coarsened_shared_current_time(bool cross_origin_isolated_capability)
|
||||||
|
{
|
||||||
|
// The coarsened shared current time given an optional boolean crossOriginIsolatedCapability (default false), must return the result of calling coarsen time with the unsafe shared current time and crossOriginIsolatedCapability.
|
||||||
|
return coarsen_time(HTML::main_thread_event_loop().unsafe_shared_current_time(), cross_origin_isolated_capability);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
||||||
|
* Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -11,5 +12,6 @@
|
||||||
namespace Web::HighResolutionTime {
|
namespace Web::HighResolutionTime {
|
||||||
|
|
||||||
DOMHighResTimeStamp coarsen_time(DOMHighResTimeStamp timestamp, bool cross_origin_isolated_capability = false);
|
DOMHighResTimeStamp coarsen_time(DOMHighResTimeStamp timestamp, bool cross_origin_isolated_capability = false);
|
||||||
|
DOMHighResTimeStamp coarsened_shared_current_time(bool cross_origin_isolated_capability = false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue