LibWeb: Don't store WindowOrWorkerGlobalScopeMixin in Performance

It wasn't used anyways, instead preferring to do dynamic_casts in every
method. Let's keep doing that, but move it into a helper function.
This commit is contained in:
Matthew Olsson 2024-04-05 18:04:01 -07:00 committed by Andreas Kling
commit 3c3ead5ff4
Notes: sideshowbarker 2024-07-16 17:12:03 +09:00
5 changed files with 35 additions and 56 deletions

View file

@ -10,9 +10,8 @@ namespace Web::NavigationTiming {
JS_DEFINE_ALLOCATOR(PerformanceTiming);
PerformanceTiming::PerformanceTiming(HTML::WindowOrWorkerGlobalScopeMixin& window_or_worker)
: PlatformObject(window_or_worker.this_impl().realm())
, m_window_or_worker(window_or_worker)
PerformanceTiming::PerformanceTiming(JS::Realm& realm)
: PlatformObject(realm)
{
}
@ -24,11 +23,4 @@ void PerformanceTiming::initialize(JS::Realm& realm)
WEB_SET_PROTOTYPE_FOR_INTERFACE(PerformanceTiming);
}
void PerformanceTiming::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
if (m_window_or_worker)
visitor.visit(m_window_or_worker->this_impl());
}
}