mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 16:58:52 +00:00
LibWeb: Add a time origin property for all ESOs
This acts as a baseline for performance related timestamps.
This commit is contained in:
parent
a8904451ff
commit
8963e62a5e
Notes:
github-actions[bot]
2025-01-27 13:54:41 +00:00
Author: https://github.com/tcl3
Commit: 8963e62a5e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3341
9 changed files with 29 additions and 5 deletions
|
@ -18,9 +18,10 @@ class WorkerEnvironmentSettingsObject final
|
|||
GC_DECLARE_ALLOCATOR(WorkerEnvironmentSettingsObject);
|
||||
|
||||
public:
|
||||
WorkerEnvironmentSettingsObject(NonnullOwnPtr<JS::ExecutionContext> execution_context, GC::Ref<WorkerGlobalScope> global_scope)
|
||||
WorkerEnvironmentSettingsObject(NonnullOwnPtr<JS::ExecutionContext> execution_context, GC::Ref<WorkerGlobalScope> global_scope, HighResolutionTime::DOMHighResTimeStamp unsafe_worker_creation_time)
|
||||
: EnvironmentSettingsObject(move(execution_context))
|
||||
, m_global_scope(global_scope)
|
||||
, m_unsafe_worker_creation_time(unsafe_worker_creation_time)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -34,6 +35,7 @@ public:
|
|||
URL::Origin origin() const override;
|
||||
PolicyContainer policy_container() const override;
|
||||
CanUseCrossOriginIsolatedAPIs cross_origin_isolated_capability() const override;
|
||||
double time_origin() const override;
|
||||
|
||||
private:
|
||||
virtual void visit_edges(JS::Cell::Visitor&) override;
|
||||
|
@ -42,6 +44,8 @@ private:
|
|||
URL::Origin m_origin;
|
||||
|
||||
GC::Ref<WorkerGlobalScope> m_global_scope;
|
||||
|
||||
HighResolutionTime::DOMHighResTimeStamp m_unsafe_worker_creation_time { 0 };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue