/* * Copyright (c) 2023, Luke Wilde * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include namespace Web::PerformanceTimeline { // https://w3c.github.io/performance-timeline/#performanceobserverentrylist-interface class PerformanceObserverEntryList final : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(PerformanceObserverEntryList, Bindings::PlatformObject); GC_DECLARE_ALLOCATOR(PerformanceObserverEntryList); public: virtual ~PerformanceObserverEntryList() override; WebIDL::ExceptionOr>> get_entries() const; WebIDL::ExceptionOr>> get_entries_by_type(String const& type) const; WebIDL::ExceptionOr>> get_entries_by_name(String const& name, Optional type) const; private: PerformanceObserverEntryList(JS::Realm&, Vector>&&); virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; // https://w3c.github.io/performance-timeline/#dfn-entry-list // Returns a PerformanceEntryList object returned by filter buffer by name and type algorithm with this's entry list, // name and type set to null. Vector> m_entry_list; }; ErrorOr>> filter_buffer_by_name_and_type(Vector> const& buffer, Optional name, Optional type); }