| 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 | 37 |
| 38 class ChildProcessFilter : public base::ProcessFilter { | 38 class ChildProcessFilter : public base::ProcessFilter { |
| 39 public: | 39 public: |
| 40 explicit ChildProcessFilter(base::ProcessId parent_pid) | 40 explicit ChildProcessFilter(base::ProcessId parent_pid) |
| 41 : parent_pids_(&parent_pid, (&parent_pid) + 1) {} | 41 : parent_pids_(&parent_pid, (&parent_pid) + 1) {} |
| 42 | 42 |
| 43 explicit ChildProcessFilter(const std::vector<base::ProcessId>& parent_pids) | 43 explicit ChildProcessFilter(const std::vector<base::ProcessId>& parent_pids) |
| 44 : parent_pids_(parent_pids.begin(), parent_pids.end()) {} | 44 : parent_pids_(parent_pids.begin(), parent_pids.end()) {} |
| 45 | 45 |
| 46 virtual bool Includes(const base::ProcessEntry& entry) const { | 46 virtual bool Includes(const base::ProcessEntry& entry) const OVERRIDE { |
| 47 return parent_pids_.find(entry.parent_pid()) != parent_pids_.end(); | 47 return parent_pids_.find(entry.parent_pid()) != parent_pids_.end(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 const std::set<base::ProcessId> parent_pids_; | 51 const std::set<base::ProcessId> parent_pids_; |
| 52 | 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(ChildProcessFilter); | 53 DISALLOW_COPY_AND_ASSIGN(ChildProcessFilter); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 const FilePath::CharType* GetRunningBrowserExecutableName() { | 56 const FilePath::CharType* GetRunningBrowserExecutableName() { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 base::ProcessHandle process) { | 151 base::ProcessHandle process) { |
| 152 #if !defined(OS_MACOSX) | 152 #if !defined(OS_MACOSX) |
| 153 process_metrics_.reset( | 153 process_metrics_.reset( |
| 154 base::ProcessMetrics::CreateProcessMetrics(process)); | 154 base::ProcessMetrics::CreateProcessMetrics(process)); |
| 155 #else | 155 #else |
| 156 process_metrics_.reset( | 156 process_metrics_.reset( |
| 157 base::ProcessMetrics::CreateProcessMetrics(process, NULL)); | 157 base::ProcessMetrics::CreateProcessMetrics(process, NULL)); |
| 158 #endif | 158 #endif |
| 159 process_handle_ = process; | 159 process_handle_ = process; |
| 160 } | 160 } |
| OLD | NEW |