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

Unified Diff: base/process/process_metrics.h

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 | « no previous file | base/process/process_metrics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_metrics.h
diff --git a/base/process/process_metrics.h b/base/process/process_metrics.h
index 327483a42e7ea1f426f407a2bfc9cddfad92a0f2..40c9644824b5967fb24e152a5a030ebc915f1f3a 100644
--- a/base/process/process_metrics.h
+++ b/base/process/process_metrics.h
@@ -90,8 +90,9 @@ struct CommittedKBytes {
BASE_EXPORT int64 TimeValToMicroseconds(const struct timeval& tv);
// Provides performance metrics for a specified process (CPU usage, memory and
-// IO counters). To use it, invoke CreateProcessMetrics() to get an instance
-// for a specific process, then access the information with the different get
+// IO counters). Use CreateCurrentProcessMetrics() to get an instance for the
+// current process, or CreateProcessMetrics() to get an instance for an
+// arbitrary process. Then, access the information with the different get
// methods.
class BASE_EXPORT ProcessMetrics {
public:
@@ -110,6 +111,11 @@ class BASE_EXPORT ProcessMetrics {
PortProvider* port_provider);
#endif // !defined(OS_MACOSX) || defined(OS_IOS)
+ // Creates a ProcessMetrics for the current process. This a cross-platform
+ // convenience wrapper for CreateProcessMetrics().
+ // The caller owns the returned object.
+ static ProcessMetrics* CreateCurrentProcessMetrics();
+
// Returns the current space allocated for the pagefile, in bytes (these pages
// may or may not be in memory). On Linux, this returns the total virtual
// memory size.
« no previous file with comments | « no previous file | base/process/process_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698