mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
LibWeb: Allow the Performance object to be used by workers
This commit is contained in:
parent
adf061a29c
commit
eebdc7bc88
Notes:
sideshowbarker
2024-07-17 16:42:19 +09:00
Author: https://github.com/tcl3
Commit: eebdc7bc88
Pull-request: https://github.com/SerenityOS/serenity/pull/23771
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/kalenikaliaksandr
Reviewed-by: https://github.com/shannonbooth
15 changed files with 49 additions and 32 deletions
|
@ -19,7 +19,9 @@ JS_DEFINE_ALLOCATOR(DocumentTimeline);
|
|||
JS::NonnullGCPtr<DocumentTimeline> DocumentTimeline::create(JS::Realm& realm, DOM::Document& document, HighResolutionTime::DOMHighResTimeStamp origin_time)
|
||||
{
|
||||
auto timeline = realm.heap().allocate<DocumentTimeline>(realm, realm, document, origin_time);
|
||||
timeline->set_current_time(document.window()->performance()->now());
|
||||
auto* window_or_worker = dynamic_cast<HTML::WindowOrWorkerGlobalScopeMixin*>(&realm.global_object());
|
||||
VERIFY(window_or_worker);
|
||||
timeline->set_current_time(window_or_worker->performance()->now());
|
||||
return timeline;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue