1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07:45 +00:00

LibWeb: Add a list of the entry names in the PerformanceTiming interface

Required for the PerformanceMark constructor, which doesn't allow any
mark names that have the same name as an attribute in the
PerformanceTiming interface in a Window context.
This commit is contained in:
Luke Wilde 2023-03-23 16:46:28 +00:00 committed by Linus Groh
parent 31b507afbf
commit 89ebef9730
3 changed files with 73 additions and 0 deletions

View file

@ -0,0 +1,29 @@
/*
* Copyright (c) 2023, Luke Wilde <lukew@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/NavigationTiming/EntryNames.h>
namespace Web::NavigationTiming::EntryNames {
#define __ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(name) FlyString name;
ENUMERATE_NAVIGATION_TIMING_ENTRY_NAMES
#undef __ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME
ErrorOr<void> initialize_strings()
{
static bool s_initialized = false;
VERIFY(!s_initialized);
#define __ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(name) \
name = TRY(#name##_fly_string);
ENUMERATE_NAVIGATION_TIMING_ENTRY_NAMES
#undef __ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME
s_initialized = true;
return {};
}
}