Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: base/process/process_metrics_mac.cc

Issue 2838803003: Add a field platform_private_footprint_ to ProcessMemoryTotals. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/process/process_metrics_mac.cc
diff --git a/base/process/process_metrics_mac.cc b/base/process/process_metrics_mac.cc
index 1481f7717f4a2b2fb490063d80a66b0da12db2cf..becd5557ab4285c990e8aba175e1f52855296261 100644
--- a/base/process/process_metrics_mac.cc
+++ b/base/process/process_metrics_mac.cc
@@ -337,6 +337,17 @@ size_t ProcessMetrics::GetPhysicalFootprint() const {
return task_vm_info.phys_footprint;
}
+size_t GetInternalAndCompressed() const {
Primiano Tucci (use gerrit) 2017/04/25 12:43:35 +ProcessMetrics::
+ task_vm_info info;
+ mach_msg_type_number_t count = TASK_VM_INFO_COUNT;
+ kern_return_t result =
+ task_info(TaskForPid(process_), TASK_VM_INFO,
+ reinterpret_cast<task_info_t>(&info), &count);
+ if (result != KERN_SUCCESS)
+ return 0;
+ return task_vm_info.internal + task_vm_info.compressed;
+}
+
#define TIME_VALUE_TO_TIMEVAL(a, r) do { \
(r)->tv_sec = (a)->seconds; \
(r)->tv_usec = (a)->microseconds; \

Powered by Google App Engine
This is Rietveld 408576698