mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-05 09:52:54 +00:00
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:
parent
ed726b6af0
commit
a4324ee6e9
Notes:
github-actions[bot]
2025-01-11 23:37:04 +00:00
Author: https://github.com/trflynn89
Commit: a4324ee6e9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3229
Reviewed-by: https://github.com/gmta ✅
38 changed files with 710 additions and 1038 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue