OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_TEST_CHROME_PROCESS_UTIL_H_ | 5 #ifndef CHROME_TEST_CHROME_PROCESS_UTIL_H_ |
6 #define CHROME_TEST_CHROME_PROCESS_UTIL_H_ | 6 #define CHROME_TEST_CHROME_PROCESS_UTIL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 | 51 |
52 bool GetIOCounters(IoCounters* io_counters) { | 52 bool GetIOCounters(IoCounters* io_counters) { |
53 return process_metrics_->GetIOCounters(io_counters); | 53 return process_metrics_->GetIOCounters(io_counters); |
54 } | 54 } |
55 | 55 |
56 base::ProcessHandle process_handle_; | 56 base::ProcessHandle process_handle_; |
57 | 57 |
58 private: | 58 private: |
59 explicit ChromeTestProcessMetrics(base::ProcessHandle process) { | 59 explicit ChromeTestProcessMetrics(base::ProcessHandle process) { |
60 process_metrics_.reset( | 60 process_metrics_.reset(base::ProcessMetrics::CreateProcessMetrics(process)); |
61 #if !defined(OS_MACOSX) | |
62 base::ProcessMetrics::CreateProcessMetrics(process)); | |
63 #else | |
64 base::ProcessMetrics::CreateProcessMetrics(process, NULL)); | |
65 #endif | |
66 process_handle_ = process; | 61 process_handle_ = process; |
67 } | 62 } |
68 | 63 |
69 scoped_ptr<base::ProcessMetrics> process_metrics_; | 64 scoped_ptr<base::ProcessMetrics> process_metrics_; |
70 | 65 |
71 DISALLOW_COPY_AND_ASSIGN(ChromeTestProcessMetrics); | 66 DISALLOW_COPY_AND_ASSIGN(ChromeTestProcessMetrics); |
72 }; | 67 }; |
73 | 68 |
74 #if defined(OS_MACOSX) | 69 #if defined(OS_MACOSX) |
75 | 70 |
(...skipping 14 matching lines...) Expand all Loading... |
90 | 85 |
91 typedef std::vector<MacChromeProcessInfo> MacChromeProcessInfoList; | 86 typedef std::vector<MacChromeProcessInfo> MacChromeProcessInfoList; |
92 | 87 |
93 // Any ProcessId that info can't be found for will be left out. | 88 // Any ProcessId that info can't be found for will be left out. |
94 MacChromeProcessInfoList GetRunningMacProcessInfo( | 89 MacChromeProcessInfoList GetRunningMacProcessInfo( |
95 const ChromeProcessList &process_list); | 90 const ChromeProcessList &process_list); |
96 | 91 |
97 #endif // defined(OS_MACOSX) | 92 #endif // defined(OS_MACOSX) |
98 | 93 |
99 #endif // CHROME_TEST_CHROME_PROCESS_UTIL_H_ | 94 #endif // CHROME_TEST_CHROME_PROCESS_UTIL_H_ |
OLD | NEW |