OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/test/base/chrome_process_util.h" | 5 #include "chrome/test/base/chrome_process_util.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 class ChildProcessFilter : public base::ProcessFilter { | 37 class ChildProcessFilter : public base::ProcessFilter { |
38 public: | 38 public: |
39 explicit ChildProcessFilter(base::ProcessId parent_pid) | 39 explicit ChildProcessFilter(base::ProcessId parent_pid) |
40 : parent_pids_(&parent_pid, (&parent_pid) + 1) {} | 40 : parent_pids_(&parent_pid, (&parent_pid) + 1) {} |
41 | 41 |
42 explicit ChildProcessFilter(const std::vector<base::ProcessId>& parent_pids) | 42 explicit ChildProcessFilter(const std::vector<base::ProcessId>& parent_pids) |
43 : parent_pids_(parent_pids.begin(), parent_pids.end()) {} | 43 : parent_pids_(parent_pids.begin(), parent_pids.end()) {} |
44 | 44 |
45 bool Includes(const base::ProcessEntry& entry) const override { | 45 bool Includes(const base::ProcessEntry& entry) const override { |
46 return ContainsKey(parent_pids_, entry.parent_pid()); | 46 return base::ContainsKey(parent_pids_, entry.parent_pid()); |
47 } | 47 } |
48 | 48 |
49 private: | 49 private: |
50 const std::set<base::ProcessId> parent_pids_; | 50 const std::set<base::ProcessId> parent_pids_; |
51 | 51 |
52 DISALLOW_COPY_AND_ASSIGN(ChildProcessFilter); | 52 DISALLOW_COPY_AND_ASSIGN(ChildProcessFilter); |
53 }; | 53 }; |
54 | 54 |
55 ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid) { | 55 ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid) { |
56 const base::FilePath::CharType* executable_name = | 56 const base::FilePath::CharType* executable_name = |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 return process_metrics_->GetPeakPagefileUsage(); | 124 return process_metrics_->GetPeakPagefileUsage(); |
125 } | 125 } |
126 | 126 |
127 size_t ChromeTestProcessMetrics::GetPeakWorkingSetSize() { | 127 size_t ChromeTestProcessMetrics::GetPeakWorkingSetSize() { |
128 return process_metrics_->GetPeakWorkingSetSize(); | 128 return process_metrics_->GetPeakWorkingSetSize(); |
129 } | 129 } |
130 | 130 |
131 bool ChromeTestProcessMetrics::GetIOCounters(base::IoCounters* io_counters) { | 131 bool ChromeTestProcessMetrics::GetIOCounters(base::IoCounters* io_counters) { |
132 return process_metrics_->GetIOCounters(io_counters); | 132 return process_metrics_->GetIOCounters(io_counters); |
133 } | 133 } |
OLD | NEW |