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

Unified Diff: base/process/process_metrics_mac.cc

Issue 2838803003: Add a field platform_private_footprint_ to ProcessMemoryTotals. (Closed)
Patch Set: Comments from mark. 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
« no previous file with comments | « base/process/process_metrics.h ('k') | base/trace_event/process_memory_totals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_metrics_mac.cc
diff --git a/base/process/process_metrics_mac.cc b/base/process/process_metrics_mac.cc
index 5eda0d0c7aa869051bae9ae6c4496dc48722bfce..ad751e37f9a1d473be9d98391272a83e26131175 100644
--- a/base/process/process_metrics_mac.cc
+++ b/base/process/process_metrics_mac.cc
@@ -287,18 +287,21 @@ bool ProcessMetrics::GetCommittedAndWorkingSetKBytes(
return true;
}
-size_t ProcessMetrics::GetPhysicalFootprint() const {
- if (mac::IsAtMostOS10_11())
- return 0;
-
+ProcessMetrics::TaskVMInfo ProcessMetrics::GetTaskVMInfo() const {
+ TaskVMInfo info;
ChromeTaskVMInfo task_vm_info;
mach_msg_type_number_t count = ChromeTaskVMInfoCount;
kern_return_t result =
task_info(TaskForPid(process_), TASK_VM_INFO,
reinterpret_cast<task_info_t>(&task_vm_info), &count);
if (result != KERN_SUCCESS)
- return 0;
- return task_vm_info.phys_footprint;
+ return info;
+
+ info.internal = task_vm_info.internal;
+ info.compressed = task_vm_info.compressed;
+ if (count == ChromeTaskVMInfoCount)
+ info.phys_footprint = task_vm_info.phys_footprint;
+ return info;
}
#define TIME_VALUE_TO_TIMEVAL(a, r) do { \
« no previous file with comments | « base/process/process_metrics.h ('k') | base/trace_event/process_memory_totals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698