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

Unified Diff: base/process/process_metrics.cc

Issue 1433603004: Add ProcessMetrics::CreateCurrentProcessMetrics() method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a_counter_with_ts
Patch Set: Remove patch dependency Created 5 years, 1 month 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_dump_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_metrics.cc
diff --git a/base/process/process_metrics.cc b/base/process/process_metrics.cc
index e48633910763892ea1f64e54a7e0dea9acb1aca1..6d99383cdf69d17c298c21f9dc79f51585c2cd29 100644
--- a/base/process/process_metrics.cc
+++ b/base/process/process_metrics.cc
@@ -43,6 +43,14 @@ scoped_ptr<Value> SystemMetrics::ToValue() const {
return res.Pass();
}
+ProcessMetrics* ProcessMetrics::CreateCurrentProcessMetrics() {
+#if !defined(OS_MACOSX) || defined(OS_IOS)
+ return CreateProcessMetrics(base::GetCurrentProcessHandle());
+#else
+ return CreateProcessMetrics(base::GetCurrentProcessHandle(), nullptr);
+#endif // !defined(OS_MACOSX) || defined(OS_IOS)
+}
+
double ProcessMetrics::GetPlatformIndependentCPUUsage() {
#if defined(OS_WIN)
return GetCPUUsage() * processor_count_;
« no previous file with comments | « base/process/process_metrics.h ('k') | base/trace_event/process_memory_totals_dump_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698