Index: base/process/process_metrics.h |
diff --git a/base/process/process_metrics.h b/base/process/process_metrics.h |
index 57cb3abec0d20e3249d029da319c96f2e10ab58b..4f08a4f74fafc10c4090d68e2afd9c6fa22241a9 100644 |
--- a/base/process/process_metrics.h |
+++ b/base/process/process_metrics.h |
@@ -11,6 +11,7 @@ |
#include <stddef.h> |
#include <stdint.h> |
+#include <memory> |
#include <string> |
#include "base/base_export.h" |
@@ -103,22 +104,22 @@ class BASE_EXPORT ProcessMetrics { |
~ProcessMetrics(); |
// Creates a ProcessMetrics for the specified process. |
- // The caller owns the returned object. |
#if !defined(OS_MACOSX) || defined(OS_IOS) |
- static ProcessMetrics* CreateProcessMetrics(ProcessHandle process); |
+ static std::unique_ptr<ProcessMetrics> CreateProcessMetrics( |
+ ProcessHandle process); |
#else |
// The port provider needs to outlive the ProcessMetrics object returned by |
// this function. If NULL is passed as provider, the returned object |
// only returns valid metrics if |process| is the current process. |
- static ProcessMetrics* CreateProcessMetrics(ProcessHandle process, |
- PortProvider* port_provider); |
+ static std::unique_ptr<ProcessMetrics> CreateProcessMetrics( |
+ ProcessHandle process, |
+ 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(); |
+ static std::unique_ptr<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 |