LibWeb: Implement performance.mark and performance.clearMarks

This commit is contained in:
Luke Wilde 2023-03-23 17:07:52 +00:00 committed by Linus Groh
commit cbe0901706
Notes: sideshowbarker 2024-07-17 03:03:44 +09:00
13 changed files with 341 additions and 0 deletions

View file

@ -9,6 +9,7 @@
#include <LibCore/ElapsedTimer.h>
#include <LibWeb/DOM/EventTarget.h>
#include <LibWeb/UserTiming/PerformanceMark.h>
namespace Web::HighResolutionTime {
@ -23,6 +24,9 @@ public:
JS::GCPtr<NavigationTiming::PerformanceTiming> timing();
WebIDL::ExceptionOr<JS::NonnullGCPtr<UserTiming::PerformanceMark>> mark(String const& mark_name, UserTiming::PerformanceMarkOptions const& mark_options = {});
void clear_marks(Optional<String> mark_name);
WebIDL::ExceptionOr<Vector<JS::Handle<PerformanceTimeline::PerformanceEntry>>> get_entries() const;
WebIDL::ExceptionOr<Vector<JS::Handle<PerformanceTimeline::PerformanceEntry>>> get_entries_by_type(String const& type) const;
WebIDL::ExceptionOr<Vector<JS::Handle<PerformanceTimeline::PerformanceEntry>>> get_entries_by_name(String const& name, Optional<String> type) const;