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

Side by Side Diff: base/process/process_metrics.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « base/process/process_metrics.h ('k') | base/process/process_metrics_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/process/process_metrics.h" 5 #include "base/process/process_metrics.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 13 matching lines...) Expand all
24 GetSystemMemoryInfo(&system_metrics.memory_info_); 24 GetSystemMemoryInfo(&system_metrics.memory_info_);
25 GetSystemDiskInfo(&system_metrics.disk_info_); 25 GetSystemDiskInfo(&system_metrics.disk_info_);
26 #endif 26 #endif
27 #if defined(OS_CHROMEOS) 27 #if defined(OS_CHROMEOS)
28 GetSwapInfo(&system_metrics.swap_info_); 28 GetSwapInfo(&system_metrics.swap_info_);
29 #endif 29 #endif
30 30
31 return system_metrics; 31 return system_metrics;
32 } 32 }
33 33
34 scoped_ptr<Value> SystemMetrics::ToValue() const { 34 std::unique_ptr<Value> SystemMetrics::ToValue() const {
35 scoped_ptr<DictionaryValue> res(new DictionaryValue()); 35 std::unique_ptr<DictionaryValue> res(new DictionaryValue());
36 36
37 res->SetInteger("committed_memory", static_cast<int>(committed_memory_)); 37 res->SetInteger("committed_memory", static_cast<int>(committed_memory_));
38 #if defined(OS_LINUX) || defined(OS_ANDROID) 38 #if defined(OS_LINUX) || defined(OS_ANDROID)
39 res->Set("meminfo", memory_info_.ToValue()); 39 res->Set("meminfo", memory_info_.ToValue());
40 res->Set("diskinfo", disk_info_.ToValue()); 40 res->Set("diskinfo", disk_info_.ToValue());
41 #endif 41 #endif
42 #if defined(OS_CHROMEOS) 42 #if defined(OS_CHROMEOS)
43 res->Set("swapinfo", swap_info_.ToValue()); 43 res->Set("swapinfo", swap_info_.ToValue());
44 #endif 44 #endif
45 45
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 return (wakeups_delta_for_ms + time_delta / 2) / time_delta; 89 return (wakeups_delta_for_ms + time_delta / 2) / time_delta;
90 } 90 }
91 #else 91 #else
92 int ProcessMetrics::GetIdleWakeupsPerSecond() { 92 int ProcessMetrics::GetIdleWakeupsPerSecond() {
93 NOTIMPLEMENTED(); // http://crbug.com/120488 93 NOTIMPLEMENTED(); // http://crbug.com/120488
94 return 0; 94 return 0;
95 } 95 }
96 #endif // defined(OS_MACOSX) || defined(OS_LINUX) 96 #endif // defined(OS_MACOSX) || defined(OS_LINUX)
97 97
98 } // namespace base 98 } // namespace base
OLDNEW
« no previous file with comments | « base/process/process_metrics.h ('k') | base/process/process_metrics_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698