mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-31 07:22:50 +00:00
LibCore: Move CObject serialization into CObject::save_to(JsonObject&)
The idea is for subclasses to override this and add whatever properties are relevant for them, then call up to their base class, etc.
This commit is contained in:
parent
a32123f221
commit
c2213449c0
Notes:
sideshowbarker
2024-07-19 12:35:57 +09:00
Author: https://github.com/awesomekling
Commit: c2213449c0
3 changed files with 16 additions and 4 deletions
|
@ -61,10 +61,7 @@ CEventLoop::CEventLoop()
|
|||
JsonArray objects;
|
||||
for (auto& object : CObject::all_objects()) {
|
||||
JsonObject json_object;
|
||||
json_object.set("class_name", object.class_name());
|
||||
json_object.set("address", String::format("%p", &object));
|
||||
json_object.set("name", object.name());
|
||||
json_object.set("parent", String::format("%p", object.parent()));
|
||||
object.save_to(json_object);
|
||||
objects.append(move(json_object));
|
||||
}
|
||||
client->write(objects.to_string());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue