LibWeb: Separate adding to performance buffers and queueing to observers

The User Timing, Resource Timing and Navigation Timing specifications
have not been updated to account for the queue method to also append to
the underlying performance buffer and it's method of checking it's
full.

This separates the functionality into a different function, with a flag
to indicate whether to use the custom full buffer logic or not.
This commit is contained in:
Luke Wilde 2025-02-26 14:58:17 +00:00 committed by Andrew Kaster
commit 67cfb64d07
Notes: github-actions[bot] 2025-03-06 16:02:20 +00:00
3 changed files with 41 additions and 15 deletions

View file

@ -47,8 +47,14 @@ public:
void clear_interval(i32);
void clear_map_of_active_timers();
enum class CheckIfPerformanceBufferIsFull {
No,
Yes,
};
PerformanceTimeline::PerformanceEntryTuple& relevant_performance_entry_tuple(FlyString const& entry_type);
void queue_performance_entry(GC::Ref<PerformanceTimeline::PerformanceEntry> new_entry);
void add_performance_entry(GC::Ref<PerformanceTimeline::PerformanceEntry> new_entry, CheckIfPerformanceBufferIsFull check_if_performance_buffer_is_full = CheckIfPerformanceBufferIsFull::No);
void clear_performance_entry_buffer(Badge<HighResolutionTime::Performance>, FlyString const& entry_type);
void remove_entries_from_performance_entry_buffer(Badge<HighResolutionTime::Performance>, FlyString const& entry_type, String entry_name);