diff options
Diffstat (limited to 'www/chromium-uc/patches/patch-base_process_process_metrics_h')
| -rw-r--r-- | www/chromium-uc/patches/patch-base_process_process_metrics_h | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/www/chromium-uc/patches/patch-base_process_process_metrics_h b/www/chromium-uc/patches/patch-base_process_process_metrics_h new file mode 100644 index 0000000..7cf3c6b --- /dev/null +++ b/www/chromium-uc/patches/patch-base_process_process_metrics_h | |||
| @@ -0,0 +1,122 @@ | |||
| 1 | $OpenBSD: patch-base_process_process_metrics_h,v 1.30 2021/11/16 11:28:45 robert Exp $ | ||
| 2 | |||
| 3 | Index: base/process/process_metrics.h | ||
| 4 | --- base/process/process_metrics.h.orig | ||
| 5 | +++ base/process/process_metrics.h | ||
| 6 | @@ -38,7 +38,7 @@ | ||
| 7 | #endif | ||
| 8 | |||
| 9 | #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ | ||
| 10 | - defined(OS_AIX) | ||
| 11 | + defined(OS_AIX) || defined(OS_BSD) | ||
| 12 | #include <string> | ||
| 13 | #include <utility> | ||
| 14 | #include <vector> | ||
| 15 | @@ -54,7 +54,7 @@ class Value; | ||
| 16 | // Full declaration is in process_metrics_iocounters.h. | ||
| 17 | struct IoCounters; | ||
| 18 | |||
| 19 | -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) | ||
| 20 | +#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) | ||
| 21 | // Minor and major page fault counts since the process creation. | ||
| 22 | // Both counts are process-wide, and exclude child processes. | ||
| 23 | // | ||
| 24 | @@ -108,7 +108,7 @@ class BASE_EXPORT ProcessMetrics { | ||
| 25 | // convenience wrapper for CreateProcessMetrics(). | ||
| 26 | static std::unique_ptr<ProcessMetrics> CreateCurrentProcessMetrics(); | ||
| 27 | |||
| 28 | -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) | ||
| 29 | +#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) | ||
| 30 | // Resident Set Size is a Linux/Android specific memory concept. Do not | ||
| 31 | // attempt to extend this to other platforms. | ||
| 32 | BASE_EXPORT size_t GetResidentSetSize() const; | ||
| 33 | @@ -135,7 +135,7 @@ class BASE_EXPORT ProcessMetrics { | ||
| 34 | TimeDelta GetCumulativeCPUUsage() WARN_UNUSED_RESULT; | ||
| 35 | |||
| 36 | #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ | ||
| 37 | - defined(OS_AIX) | ||
| 38 | + defined(OS_AIX) || defined(OS_BSD) | ||
| 39 | // Emits the cumulative CPU usage for all currently active threads since they | ||
| 40 | // were started into the output parameter (replacing its current contents). | ||
| 41 | // Threads that have already terminated will not be reported. Thus, the sum of | ||
| 42 | @@ -218,7 +218,7 @@ class BASE_EXPORT ProcessMetrics { | ||
| 43 | int GetOpenFdSoftLimit() const; | ||
| 44 | #endif // defined(OS_POSIX) | ||
| 45 | |||
| 46 | -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) | ||
| 47 | +#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) | ||
| 48 | // Bytes of swap as reported by /proc/[pid]/status. | ||
| 49 | uint64_t GetVmSwapBytes() const; | ||
| 50 | |||
| 51 | @@ -238,7 +238,7 @@ class BASE_EXPORT ProcessMetrics { | ||
| 52 | #endif // !defined(OS_MAC) | ||
| 53 | |||
| 54 | #if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ | ||
| 55 | - defined(OS_AIX) | ||
| 56 | + defined(OS_AIX) || defined(OS_BSD) | ||
| 57 | int CalculateIdleWakeupsPerSecond(uint64_t absolute_idle_wakeups); | ||
| 58 | #endif | ||
| 59 | #if defined(OS_APPLE) | ||
| 60 | @@ -249,7 +249,7 @@ class BASE_EXPORT ProcessMetrics { | ||
| 61 | #endif | ||
| 62 | |||
| 63 | #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ | ||
| 64 | - defined(OS_AIX) | ||
| 65 | + defined(OS_AIX) || defined(OS_BSD) | ||
| 66 | CPU::CoreType GetCoreType(int core_index); | ||
| 67 | #endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || | ||
| 68 | // defined(OS_AIX) | ||
| 69 | @@ -274,7 +274,7 @@ class BASE_EXPORT ProcessMetrics { | ||
| 70 | uint64_t last_cumulative_disk_usage_ = 0; | ||
| 71 | |||
| 72 | #if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ | ||
| 73 | - defined(OS_AIX) | ||
| 74 | + defined(OS_AIX) || defined(OS_BSD) | ||
| 75 | // Same thing for idle wakeups. | ||
| 76 | TimeTicks last_idle_wakeups_time_; | ||
| 77 | uint64_t last_absolute_idle_wakeups_; | ||
| 78 | @@ -317,7 +317,7 @@ BASE_EXPORT void IncreaseFdLimitTo(unsigned int max_de | ||
| 79 | |||
| 80 | #if defined(OS_WIN) || defined(OS_APPLE) || defined(OS_LINUX) || \ | ||
| 81 | defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_AIX) || \ | ||
| 82 | - defined(OS_FUCHSIA) | ||
| 83 | + defined(OS_FUCHSIA) || defined(OS_BSD) | ||
| 84 | // Data about system-wide memory consumption. Values are in KB. Available on | ||
| 85 | // Windows, Mac, Linux, Android and Chrome OS. | ||
| 86 | // | ||
| 87 | @@ -352,7 +352,7 @@ struct BASE_EXPORT SystemMemoryInfoKB { | ||
| 88 | #endif | ||
| 89 | |||
| 90 | #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ | ||
| 91 | - defined(OS_AIX) | ||
| 92 | + defined(OS_AIX) || defined(OS_BSD) | ||
| 93 | // This provides an estimate of available memory as described here: | ||
| 94 | // https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773 | ||
| 95 | // NOTE: this is ONLY valid in kernels 3.14 and up. Its value will always | ||
| 96 | @@ -367,7 +367,7 @@ struct BASE_EXPORT SystemMemoryInfoKB { | ||
| 97 | #endif | ||
| 98 | |||
| 99 | #if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ | ||
| 100 | - defined(OS_AIX) || defined(OS_FUCHSIA) | ||
| 101 | + defined(OS_AIX) || defined(OS_FUCHSIA) || defined(OS_BSD) | ||
| 102 | int buffers = 0; | ||
| 103 | int cached = 0; | ||
| 104 | int active_anon = 0; | ||
| 105 | @@ -404,7 +404,7 @@ BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoK | ||
| 106 | // defined(OS_FUCHSIA) | ||
| 107 | |||
| 108 | #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ | ||
| 109 | - defined(OS_AIX) | ||
| 110 | + defined(OS_AIX) || defined(OS_BSD) | ||
| 111 | // Parse the data found in /proc/<pid>/stat and return the sum of the | ||
| 112 | // CPU-related ticks. Returns -1 on parse error. | ||
| 113 | // Exposed for testing. | ||
| 114 | @@ -591,7 +591,7 @@ class BASE_EXPORT SystemMetrics { | ||
| 115 | FRIEND_TEST_ALL_PREFIXES(SystemMetricsTest, SystemMetrics); | ||
| 116 | |||
| 117 | size_t committed_memory_; | ||
| 118 | -#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) | ||
| 119 | +#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_BSD) | ||
| 120 | SystemMemoryInfoKB memory_info_; | ||
| 121 | VmStatInfo vmstat_info_; | ||
| 122 | SystemDiskInfo disk_info_; | ||
