Chromium Code Reviews| Index: chrome/browser/memory_details_mac.cc |
| diff --git a/chrome/browser/memory_details_mac.cc b/chrome/browser/memory_details_mac.cc |
| index 571e739d694b780262f4b9db587a3641a48731b6..30d9e861c225d9ca02bdeece349e711dc9f1dffd 100644 |
| --- a/chrome/browser/memory_details_mac.cc |
| +++ b/chrome/browser/memory_details_mac.cc |
| @@ -14,6 +14,7 @@ |
| #include "base/file_version_info.h" |
| #include "base/files/file_path.h" |
| #include "base/mac/foundation_util.h" |
| +#include "base/mac/mac_util.h" |
| #include "base/process/process_iterator.h" |
| #include "base/strings/string_util.h" |
| #include "base/strings/utf_string_conversions.h" |
| @@ -62,7 +63,16 @@ void CollectProcessDataForChromeProcess( |
| base::ProcessMetrics::CreateProcessMetrics( |
| pid, content::BrowserChildProcessHost::GetPortProvider()); |
| metrics->GetCommittedAndWorkingSetKBytes(&info.committed, &info.working_set); |
| - info.phys_footprint = metrics->GetTaskVMInfo().phys_footprint; |
| + base::ProcessMetrics::TaskVMInfo vm_info = metrics->GetTaskVMInfo(); |
| + info.phys_footprint = vm_info.phys_footprint; |
| + |
| + // TODO(erikchen): Remove this temporary estimate for private memory once the |
| + // memory infra service emits the same metric. https://crbug.com/720541. |
| + if (base::mac::IsAtLeastOS10_12()) { |
| + info.private_memory_footprint = vm_info.phys_footprint; |
|
Nico
2017/05/11 20:12:59
are you sure that you want to send differently com
erikchen
2017/05/11 21:02:22
Yup. The first API is strictly better, but not ava
|
| + } else { |
| + info.private_memory_footprint = vm_info.internal + vm_info.compressed; |
| + } |
| processes->push_back(info); |
| } |