From 1dd6b7f5b787e1893b708ddf58492f9fdd50ae51 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 21 Dec 2022 11:42:06 +0000 Subject: AK+Everywhere: Rename JsonObject::get() to ::get_deprecated() This is a preparatory step to making `get()` return `ErrorOr`. --- Userland/Applets/ResourceGraph/main.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'Userland/Applets/ResourceGraph') diff --git a/Userland/Applets/ResourceGraph/main.cpp b/Userland/Applets/ResourceGraph/main.cpp index 1c43ba4843..ca418f3894 100644 --- a/Userland/Applets/ResourceGraph/main.cpp +++ b/Userland/Applets/ResourceGraph/main.cpp @@ -167,8 +167,8 @@ private: return false; auto const& obj = json.value().as_object(); - total = obj.get("total_time"sv).to_u64(); - idle = obj.get("idle_time"sv).to_u64(); + total = obj.get_deprecated("total_time"sv).to_u64(); + idle = obj.get_deprecated("idle_time"sv).to_u64(); return true; } @@ -179,11 +179,11 @@ private: return false; auto const& obj = json.value().as_object(); - unsigned kmalloc_allocated = obj.get("kmalloc_allocated"sv).to_u32(); - unsigned kmalloc_available = obj.get("kmalloc_available"sv).to_u32(); - auto physical_allocated = obj.get("physical_allocated"sv).to_u64(); - auto physical_committed = obj.get("physical_committed"sv).to_u64(); - auto physical_uncommitted = obj.get("physical_uncommitted"sv).to_u64(); + unsigned kmalloc_allocated = obj.get_deprecated("kmalloc_allocated"sv).to_u32(); + unsigned kmalloc_available = obj.get_deprecated("kmalloc_available"sv).to_u32(); + auto physical_allocated = obj.get_deprecated("physical_allocated"sv).to_u64(); + auto physical_committed = obj.get_deprecated("physical_committed"sv).to_u64(); + auto physical_uncommitted = obj.get_deprecated("physical_uncommitted"sv).to_u64(); unsigned kmalloc_bytes_total = kmalloc_allocated + kmalloc_available; unsigned kmalloc_pages_total = (kmalloc_bytes_total + PAGE_SIZE - 1) / PAGE_SIZE; u64 total_userphysical_and_swappable_pages = kmalloc_pages_total + physical_allocated + physical_committed + physical_uncommitted; @@ -203,13 +203,13 @@ private: auto const& array = json.value().as_array(); for (auto const& adapter_value : array.values()) { auto const& adapter_obj = adapter_value.as_object(); - if (!adapter_obj.has_string("ipv4_address"sv) || !adapter_obj.get("link_up"sv).as_bool()) + if (!adapter_obj.has_string("ipv4_address"sv) || !adapter_obj.get_deprecated("link_up"sv).as_bool()) continue; - tx += adapter_obj.get("bytes_in"sv).to_u64(); - rx += adapter_obj.get("bytes_out"sv).to_u64(); + tx += adapter_obj.get_deprecated("bytes_in"sv).to_u64(); + rx += adapter_obj.get_deprecated("bytes_out"sv).to_u64(); // Link speed data is given in megabits, but we want all return values to be in bytes. - link_speed += adapter_obj.get("link_speed"sv).to_u64() * 8'000'000; + link_speed += adapter_obj.get_deprecated("link_speed"sv).to_u64() * 8'000'000; } link_speed /= 8; return tx != 0; -- cgit v1.2.3