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

Unified Diff: chrome/browser/memory_details_mac.cc

Issue 2875823004: Add experimental private memory footprint metrics. (Closed)
Patch Set: compile error. Created 3 years, 7 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 | « chrome/browser/memory_details.cc ('k') | chrome/browser/metrics/metrics_memory_details.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « chrome/browser/memory_details.cc ('k') | chrome/browser/metrics/metrics_memory_details.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698