diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-12-21 16:51:33 +0000 |
---|---|---|
committer | Tim Flynn <trflynn89@pm.me> | 2023-01-26 09:57:14 -0500 |
commit | 269ce258b49f8181dbb9eee57d4978791719a3a8 (patch) | |
tree | 18bbe816e857e8ddcbb5e9bf187035073674696d /Userland/Libraries/LibCore/EventLoop.cpp | |
parent | d55f763fcd22ff3daf4c22417d1554c5b3faf074 (diff) | |
download | serenity-269ce258b49f8181dbb9eee57d4978791719a3a8.zip |
LibCore: Replace uses of JsonObject::get_deprecated()/get_ptr()
Diffstat (limited to 'Userland/Libraries/LibCore/EventLoop.cpp')
-rw-r--r-- | Userland/Libraries/LibCore/EventLoop.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Libraries/LibCore/EventLoop.cpp b/Userland/Libraries/LibCore/EventLoop.cpp index f8c0a76f53..9fbcc76dc5 100644 --- a/Userland/Libraries/LibCore/EventLoop.cpp +++ b/Userland/Libraries/LibCore/EventLoop.cpp @@ -227,16 +227,16 @@ public: void handle_request(JsonObject const& request) { - auto type = request.get_deprecated("type"sv).as_string_or({}); + auto type = request.get_deprecated_string("type"sv); - if (type.is_null()) { + if (!type.has_value()) { dbgln("RPC client sent request without type field"); return; } if (type == "Identify") { JsonObject response; - response.set("type", type); + response.set("type", type.value()); response.set("pid", getpid()); #ifdef AK_OS_SERENITY char buffer[1024]; @@ -252,7 +252,7 @@ public: if (type == "GetAllObjects") { JsonObject response; - response.set("type", type); + response.set("type", type.value()); JsonArray objects; for (auto& object : Object::all_objects()) { JsonObject json_object; @@ -265,7 +265,7 @@ public: } if (type == "SetInspectedObject") { - auto address = request.get_deprecated("address"sv).to_number<FlatPtr>(); + auto address = request.get_addr("address"sv); for (auto& object : Object::all_objects()) { if ((FlatPtr)&object == address) { if (auto inspected_object = m_inspected_object.strong_ref()) @@ -279,10 +279,10 @@ public: } if (type == "SetProperty") { - auto address = request.get_deprecated("address"sv).to_number<FlatPtr>(); + auto address = request.get_addr("address"sv); for (auto& object : Object::all_objects()) { if ((FlatPtr)&object == address) { - bool success = object.set_property(request.get_deprecated("name"sv).to_deprecated_string(), request.get_deprecated("value"sv)); + bool success = object.set_property(request.get_deprecated_string("name"sv).value(), request.get("value"sv).value()); JsonObject response; response.set("type", "SetProperty"); response.set("success", success); |