mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibCore: Add a way to set an individual Core::Object property remotely
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 08:53:53 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/42f2696355e
@@ -171,8 +171,25 @@ public:
|
||||
m_inspected_object->decrement_inspector_count({});
|
||||
m_inspected_object = object.make_weak_ptr();
|
||||
m_inspected_object->increment_inspector_count({});
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == "SetProperty") {
|
||||
auto address = request.get("address").to_number<uintptr_t>();
|
||||
for (auto& object : Object::all_objects()) {
|
||||
if ((uintptr_t)&object == address) {
|
||||
bool success = object.set_property(request.get("name").to_string(), request.get("value"));
|
||||
JsonObject response;
|
||||
response.set("type", "SetProperty");
|
||||
response.set("success", success);
|
||||
send_response(response);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == "Disconnect") {
|
||||
|
||||
Reference in New Issue
Block a user