1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +00:00

AK+Everywhere: Rename JsonObject::get() to ::get_deprecated()

This is a preparatory step to making `get()` return `ErrorOr`.
This commit is contained in:
Sam Atkins 2022-12-21 11:42:06 +00:00 committed by Tim Flynn
parent efe4329f9f
commit 1dd6b7f5b7
76 changed files with 671 additions and 671 deletions

View file

@ -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;