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

Unified Diff: base/process/process_metrics_freebsd.cc

Issue 2181493002: Return unique_ptrs from base::ProcessMetrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove os_resource_win.* Created 4 years, 5 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 | « base/process/process_metrics.cc ('k') | base/process/process_metrics_ios.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_metrics_freebsd.cc
diff --git a/base/process/process_metrics_freebsd.cc b/base/process/process_metrics_freebsd.cc
index 5fd93cbe1c99d3fb16ca3d9968ff46e681f12ac5..686f6338724da2e11a08ff3c5c4231b833029ccd 100644
--- a/base/process/process_metrics_freebsd.cc
+++ b/base/process/process_metrics_freebsd.cc
@@ -10,20 +10,21 @@
#include <unistd.h>
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/sys_info.h"
namespace base {
ProcessMetrics::ProcessMetrics(ProcessHandle process)
: process_(process),
+ processor_count_(SysInfo::NumberOfProcessors()),
last_system_time_(0),
- last_cpu_(0) {
- processor_count_ = base::SysInfo::NumberOfProcessors();
-}
+ last_cpu_(0) {}
// static
-ProcessMetrics* ProcessMetrics::CreateProcessMetrics(ProcessHandle process) {
- return new ProcessMetrics(process);
+std::unique_ptr<ProcessMetrics> ProcessMetrics::CreateProcessMetrics(
+ ProcessHandle process) {
+ return WrapUnique(new ProcessMetrics(process));
dcheng 2016/07/26 05:21:38 Nit: base::MakeUnique while you're changing this?
Lei Zhang 2016/07/26 05:53:02 I guess you missed my comment. How do we deal with
}
size_t ProcessMetrics::GetPagefileUsage() const {
« no previous file with comments | « base/process/process_metrics.cc ('k') | base/process/process_metrics_ios.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698