1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09:00

Everywhere: Make JSON serialization fallible

This allows us to eliminate a major source of infallible allocation in
the Kernel, as well as lay down the groundwork for OOM fallibility in
userland.
This commit is contained in:
Idan Horowitz 2022-02-24 20:08:48 +02:00 committed by Andreas Kling
parent 6682afb5d4
commit feb00b7105
Notes: sideshowbarker 2024-07-17 18:09:57 +09:00
18 changed files with 837 additions and 592 deletions

View file

@ -1185,10 +1185,10 @@ void Document::set_cookie(String const& cookie_string, Cookie::Source source)
String Document::dump_dom_tree_as_json() const
{
StringBuilder builder;
JsonObjectSerializer json(builder);
auto json = MUST(JsonObjectSerializer<>::try_create(builder));
serialize_tree_as_json(json);
json.finish();
MUST(json.finish());
return builder.to_string();
}