diff options
Diffstat (limited to 'www/ungoogled-chromium/files/patch-base_process_process__metrics__openbsd.cc')
-rw-r--r-- | www/ungoogled-chromium/files/patch-base_process_process__metrics__openbsd.cc | 65 |
1 files changed, 5 insertions, 60 deletions
diff --git a/www/ungoogled-chromium/files/patch-base_process_process__metrics__openbsd.cc b/www/ungoogled-chromium/files/patch-base_process_process__metrics__openbsd.cc index d6bbb5163a77..b29ad1835e5b 100644 --- a/www/ungoogled-chromium/files/patch-base_process_process__metrics__openbsd.cc +++ b/www/ungoogled-chromium/files/patch-base_process_process__metrics__openbsd.cc @@ -1,4 +1,4 @@ ---- base/process/process_metrics_openbsd.cc.orig 2025-02-25 06:59:53 UTC +--- base/process/process_metrics_openbsd.cc.orig 2025-09-10 13:22:16 UTC +++ base/process/process_metrics_openbsd.cc @@ -6,73 +6,85 @@ @@ -14,7 +14,7 @@ #include "base/memory/ptr_util.h" #include "base/types/expected.h" +#include "base/values.h" -+#include "base/notreached.h" ++#include "base/notimplemented.h" namespace base { @@ -122,7 +122,7 @@ struct vmtotal vmtotal; unsigned long mem_total, mem_free, mem_inactive; size_t len = sizeof(vmtotal); -@@ -85,9 +97,115 @@ size_t GetSystemCommitCharge() { +@@ -85,9 +97,60 @@ size_t GetSystemCommitCharge() { mem_free = vmtotal.t_free; mem_inactive = vmtotal.t_vm - vmtotal.t_avm; @@ -130,7 +130,7 @@ + pagesize = checked_cast<size_t>(getpagesize()); return mem_total - (mem_free * pagesize) - (mem_inactive * pagesize); -+} + } + +int ProcessMetrics::GetOpenFdCount() const { + return (process_ == getpid()) ? getdtablecount() : -1; @@ -146,7 +146,7 @@ +} + +bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) { -+ NOTIMPLEMENTED_LOG_ONCE(); ++ NOTIMPLEMENTED(); + return false; +} + @@ -165,39 +165,6 @@ + return 0; +} + -+Value::Dict SystemMemoryInfoKB::ToDict() const { -+ Value::Dict res; -+ res.Set("total", total); -+ res.Set("free", free); -+ res.Set("available", available); -+ res.Set("buffers", buffers); -+ res.Set("cached", cached); -+ res.Set("active_anon", active_anon); -+ res.Set("inactive_anon", inactive_anon); -+ res.Set("active_file", active_file); -+ res.Set("inactive_file", inactive_file); -+ res.Set("swap_total", swap_total); -+ res.Set("swap_free", swap_free); -+ res.Set("swap_used", swap_total - swap_free); -+ res.Set("dirty", dirty); -+ res.Set("reclaimable", reclaimable); -+ -+ NOTIMPLEMENTED(); -+ -+ return res; -+} -+ -+Value::Dict VmStatInfo::ToDict() const { -+ Value::Dict res; -+ res.Set("pswpin", static_cast<int>(pswpin)); -+ res.Set("pswpout", static_cast<int>(pswpout)); -+ res.Set("pgmajfault", static_cast<int>(pgmajfault)); -+ -+ NOTIMPLEMENTED(); -+ -+ return res; -+} -+ +SystemDiskInfo::SystemDiskInfo() { + reads = 0; + reads_merged = 0; @@ -215,27 +182,5 @@ +SystemDiskInfo::SystemDiskInfo(const SystemDiskInfo&) = default; + +SystemDiskInfo& SystemDiskInfo::operator=(const SystemDiskInfo&) = default; -+ -+Value::Dict SystemDiskInfo::ToDict() const { -+ Value::Dict res; -+ -+ // Write out uint64_t variables as doubles. -+ // Note: this may discard some precision, but for JS there's no other option. -+ res.Set("reads", static_cast<double>(reads)); -+ res.Set("reads_merged", static_cast<double>(reads_merged)); -+ res.Set("sectors_read", static_cast<double>(sectors_read)); -+ res.Set("read_time", static_cast<double>(read_time)); -+ res.Set("writes", static_cast<double>(writes)); -+ res.Set("writes_merged", static_cast<double>(writes_merged)); -+ res.Set("sectors_written", static_cast<double>(sectors_written)); -+ res.Set("write_time", static_cast<double>(write_time)); -+ res.Set("io", static_cast<double>(io)); -+ res.Set("io_time", static_cast<double>(io_time)); -+ res.Set("weighted_io_time", static_cast<double>(weighted_io_time)); -+ -+ NOTIMPLEMENTED(); -+ -+ return res; - } } // namespace base |