ladybird/Userland/Libraries/LibWeb/NavigationTiming/EntryNames.cpp
Luke Wilde 89ebef9730 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.
2023-03-23 21:00:43 +00:00

29 lines
702 B
C++

/*
* 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 {};
}
}