mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Inspector: Replace uses of JsonObject::get_deprecated()/get_ptr()
This commit is contained in:
parent
141aa37eda
commit
33ab3a212f
Notes:
sideshowbarker
2024-07-17 22:09:47 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/33ab3a212f Pull-request: https://github.com/SerenityOS/serenity/pull/17185
1 changed files with 7 additions and 8 deletions
|
@ -28,10 +28,10 @@ RemoteProcess::RemoteProcess(pid_t pid)
|
|||
|
||||
void RemoteProcess::handle_identify_response(JsonObject const& response)
|
||||
{
|
||||
int pid = response.get_deprecated("pid"sv).to_int();
|
||||
int pid = response.get_i32("pid"sv).value_or(0);
|
||||
VERIFY(pid == m_pid);
|
||||
|
||||
m_process_name = response.get_deprecated("process_name"sv).as_string_or({});
|
||||
m_process_name = response.get_deprecated_string("process_name"sv).value_or({});
|
||||
|
||||
if (on_update)
|
||||
on_update();
|
||||
|
@ -40,8 +40,7 @@ void RemoteProcess::handle_identify_response(JsonObject const& response)
|
|||
void RemoteProcess::handle_get_all_objects_response(JsonObject const& response)
|
||||
{
|
||||
// FIXME: It would be good if we didn't have to make a local copy of the array value here!
|
||||
auto objects = response.get_deprecated("objects"sv);
|
||||
auto& object_array = objects.as_array();
|
||||
auto& object_array = response.get_array("objects"sv).value();
|
||||
|
||||
NonnullOwnPtrVector<RemoteObject> remote_objects;
|
||||
HashMap<FlatPtr, RemoteObject*> objects_by_address;
|
||||
|
@ -50,10 +49,10 @@ void RemoteProcess::handle_get_all_objects_response(JsonObject const& response)
|
|||
VERIFY(value.is_object());
|
||||
auto& object = value.as_object();
|
||||
auto remote_object = make<RemoteObject>();
|
||||
remote_object->address = object.get_deprecated("address"sv).to_number<FlatPtr>();
|
||||
remote_object->parent_address = object.get_deprecated("parent"sv).to_number<FlatPtr>();
|
||||
remote_object->name = object.get_deprecated("name"sv).to_deprecated_string();
|
||||
remote_object->class_name = object.get_deprecated("class_name"sv).to_deprecated_string();
|
||||
remote_object->address = object.get_addr("address"sv).value_or(0);
|
||||
remote_object->parent_address = object.get_addr("parent"sv).value_or(0);
|
||||
remote_object->name = object.get_deprecated_string("name"sv).value_or({});
|
||||
remote_object->class_name = object.get_deprecated_string("class_name"sv).value_or({});
|
||||
remote_object->json = object;
|
||||
objects_by_address.set(remote_object->address, remote_object);
|
||||
remote_objects.append(move(remote_object));
|
||||
|
|
Loading…
Reference in a new issue