diff options
author | Luke Wilde <lukew@serenityos.org> | 2023-03-22 19:12:57 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-03-23 21:00:43 +0000 |
commit | 31b507afbf74391d24490835c5581b6a00eb0d0f (patch) | |
tree | 7413c7d6e24a0f7eb1aa4aa3d6c6cd3f92daa295 /Userland/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.h | |
parent | 4c3f1481ea15fb855e62843674ede79bdecfe91d (diff) | |
download | serenity-31b507afbf74391d24490835c5581b6a00eb0d0f.zip |
LibWeb: Introduce Performance Timeline and its Performance functions
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.h')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.h b/Userland/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.h index 240015eb7c..c6c9133866 100644 --- a/Userland/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.h +++ b/Userland/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.h @@ -1,11 +1,13 @@ /* * Copyright (c) 2023, Linus Groh <linusg@serenityos.org> + * Copyright (c) 2023, Luke Wilde <lukew@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once +#include <AK/FlyString.h> #include <AK/Forward.h> #include <AK/HashMap.h> #include <AK/IDAllocator.h> @@ -14,6 +16,8 @@ #include <LibWeb/Fetch/Request.h> #include <LibWeb/Forward.h> #include <LibWeb/HTML/MessagePort.h> +#include <LibWeb/PerformanceTimeline/PerformanceEntry.h> +#include <LibWeb/PerformanceTimeline/PerformanceEntryTuple.h> namespace Web::HTML { @@ -43,6 +47,8 @@ public: void clear_timeout(i32); void clear_interval(i32); + ErrorOr<Vector<JS::Handle<PerformanceTimeline::PerformanceEntry>>> filter_buffer_map_by_name_and_type(Optional<String> name, Optional<String> type) const; + protected: void visit_edges(JS::Cell::Visitor&); @@ -55,6 +61,16 @@ private: IDAllocator m_timer_id_allocator; HashMap<int, JS::NonnullGCPtr<Timer>> m_timers; + + // https://www.w3.org/TR/performance-timeline/#performance-timeline + // Each global object has: + // FIXME: - a performance observer task queued flag + // FIXME: - a list of registered performance observer objects that is initially empty + + // https://www.w3.org/TR/performance-timeline/#dfn-performance-entry-buffer-map + // a performance entry buffer map map, keyed on a DOMString, representing the entry type to which the buffer belongs. The map's value is the following tuple: + // NOTE: See the PerformanceEntryTuple struct above for the map's value tuple. + OrderedHashMap<FlyString, PerformanceTimeline::PerformanceEntryTuple> m_performance_entry_buffer_map; }; } |