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. |