LibWeb: Remove the initialize_strings methods

We added these methods to propagate OOM errors at process startup, but
we longer fret about these tiny OOM failures. Requiring that these init
methods be called prohibits using these strings in processes that have
not set up a MainThreadVM. So let's just remove them and initialize the
strings in a sane manner.

In doing so, this also standardizes how we initialize strings whose C++
variable name differs from their string value. Instead of special-casing
these strings, we just include their string value in the x-macro list.
This commit is contained in:
Timothy Flynn 2025-01-11 14:07:41 -05:00 committed by Jelle Raaijmakers
parent ed726b6af0
commit a4324ee6e9
Notes: github-actions[bot] 2025-01-11 23:37:04 +00:00
38 changed files with 710 additions and 1038 deletions

View file

@ -8,21 +8,9 @@
namespace Web::NavigationTiming::EntryNames {
#define __ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(name, _) FlyString name;
#define __ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(name, _) \
FlyString name = #name##_fly_string;
ENUMERATE_NAVIGATION_TIMING_ENTRY_NAMES
#undef __ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME
void initialize_strings()
{
static bool s_initialized = false;
VERIFY(!s_initialized);
#define __ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME(name, _) \
name = #name##_fly_string;
ENUMERATE_NAVIGATION_TIMING_ENTRY_NAMES
#undef __ENUMERATE_NAVIGATION_TIMING_ENTRY_NAME
s_initialized = true;
}
}