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

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

Issue 1479473002: base: Use std::move() instead of Pass() for real movable types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: basepass: missing-include Created 5 years 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/prefs/value_map_pref_store.cc ('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>
8
7 #include "base/logging.h" 9 #include "base/logging.h"
8 #include "base/values.h" 10 #include "base/values.h"
9 11
10 namespace base { 12 namespace base {
11 13
12 SystemMetrics::SystemMetrics() { 14 SystemMetrics::SystemMetrics() {
13 committed_memory_ = 0; 15 committed_memory_ = 0;
14 } 16 }
15 17
16 SystemMetrics SystemMetrics::Sample() { 18 SystemMetrics SystemMetrics::Sample() {
(...skipping 16 matching lines...) Expand all
33 35
34 res->SetInteger("committed_memory", static_cast<int>(committed_memory_)); 36 res->SetInteger("committed_memory", static_cast<int>(committed_memory_));
35 #if defined(OS_LINUX) || defined(OS_ANDROID) 37 #if defined(OS_LINUX) || defined(OS_ANDROID)
36 res->Set("meminfo", memory_info_.ToValue()); 38 res->Set("meminfo", memory_info_.ToValue());
37 res->Set("diskinfo", disk_info_.ToValue()); 39 res->Set("diskinfo", disk_info_.ToValue());
38 #endif 40 #endif
39 #if defined(OS_CHROMEOS) 41 #if defined(OS_CHROMEOS)
40 res->Set("swapinfo", swap_info_.ToValue()); 42 res->Set("swapinfo", swap_info_.ToValue());
41 #endif 43 #endif
42 44
43 return res.Pass(); 45 return std::move(res);
44 } 46 }
45 47
46 ProcessMetrics* ProcessMetrics::CreateCurrentProcessMetrics() { 48 ProcessMetrics* ProcessMetrics::CreateCurrentProcessMetrics() {
47 #if !defined(OS_MACOSX) || defined(OS_IOS) 49 #if !defined(OS_MACOSX) || defined(OS_IOS)
48 return CreateProcessMetrics(base::GetCurrentProcessHandle()); 50 return CreateProcessMetrics(base::GetCurrentProcessHandle());
49 #else 51 #else
50 return CreateProcessMetrics(base::GetCurrentProcessHandle(), nullptr); 52 return CreateProcessMetrics(base::GetCurrentProcessHandle(), nullptr);
51 #endif // !defined(OS_MACOSX) || defined(OS_IOS) 53 #endif // !defined(OS_MACOSX) || defined(OS_IOS)
52 } 54 }
53 55
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 return (wakeups_delta_for_ms + time_delta / 2) / time_delta; 88 return (wakeups_delta_for_ms + time_delta / 2) / time_delta;
87 } 89 }
88 #else 90 #else
89 int ProcessMetrics::GetIdleWakeupsPerSecond() { 91 int ProcessMetrics::GetIdleWakeupsPerSecond() {
90 NOTIMPLEMENTED(); // http://crbug.com/120488 92 NOTIMPLEMENTED(); // http://crbug.com/120488
91 return 0; 93 return 0;
92 } 94 }
93 #endif // defined(OS_MACOSX) || defined(OS_LINUX) 95 #endif // defined(OS_MACOSX) || defined(OS_LINUX)
94 96
95 } // namespace base 97 } // namespace base
OLDNEW
« no previous file with comments | « base/prefs/value_map_pref_store.cc ('k') | base/process/process_metrics_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698