Skip to content

Truly independent web browser

LibWeb: Root the observers and entries of a performance observer task

Shannon Booth7b30f25c7e36
diff --git a/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.cpp b/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.cpp
index 8868c2d449f..31809092734 100644
--- a/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.cpp
+++ b/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.cpp
@@ -1094,7 +1094,7 @@ void WindowOrWorkerGlobalScopeMixin::queue_the_performance_observer_task()
m_performance_observer_task_queued = false;
// 2. Let notifyList be a copy of relevantGlobal's list of registered performance observer objects.
- auto notify_list = m_registered_performance_observer_objects;
+ GC::RootVector notify_list { m_registered_performance_observer_objects.values() };
// 3. For each registered performance observer object registeredObserver in notifyList, run these steps:
for (auto& registered_observer : notify_list) {
@@ -1108,7 +1108,7 @@ void WindowOrWorkerGlobalScopeMixin::queue_the_performance_observer_task()
if (entries.is_empty())
continue;
- Vector<GC::Ref<PerformanceTimeline::PerformanceEntry>> entries_as_gc_ptrs;
+ GC::RootVector<GC::Ref<PerformanceTimeline::PerformanceEntry>> entries_as_gc_ptrs;
for (auto& entry : entries)
entries_as_gc_ptrs.append(*entry);
@@ -1205,7 +1205,7 @@ bool WindowOrWorkerGlobalScopeMixin::can_add_resource_timing_entry()
size_t WindowOrWorkerGlobalScopeMixin::resource_timing_buffer_current_size()
{
// A resource timing buffer current size which is initially 0.
- auto resource_timing_tuple = relevant_performance_entry_tuple(PerformanceTimeline::EntryTypes::resource);
+ auto const& resource_timing_tuple = relevant_performance_entry_tuple(PerformanceTimeline::EntryTypes::resource);
return resource_timing_tuple.performance_entry_buffer.size();
}