| 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 #include "chrome/test/chrome_process_util.h" | 5 #include "chrome/test/chrome_process_util.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // On Linux we might be running with a zygote process for the renderers. | 91 // On Linux we might be running with a zygote process for the renderers. |
| 92 // Because of that we sweep the list of processes again and pick those which | 92 // Because of that we sweep the list of processes again and pick those which |
| 93 // are children of one of the processes that we've already seen. | 93 // are children of one of the processes that we've already seen. |
| 94 { | 94 { |
| 95 ChildProcessFilter filter(result); | 95 ChildProcessFilter filter(result); |
| 96 base::NamedProcessIterator it(chrome::kBrowserProcessExecutableName, | 96 base::NamedProcessIterator it(chrome::kBrowserProcessExecutableName, |
| 97 &filter); | 97 &filter); |
| 98 while ((process_entry = it.NextProcessEntry())) | 98 while ((process_entry = it.NextProcessEntry())) |
| 99 result.push_back(process_entry->pid); | 99 result.push_back(process_entry->pid); |
| 100 } | 100 } |
| 101 #endif | 101 #endif // defined(OS_LINUX) |
| 102 |
| 103 #if defined(OS_MACOSX) |
| 104 // On Mac OS X we run the subprocesses with a different bundle, so they end |
| 105 // up with a different name, so we have to collect them in a second pass. |
| 106 { |
| 107 ChildProcessFilter filter(browser_pid); |
| 108 base::NamedProcessIterator it(chrome::kHelperProcessExecutableName, |
| 109 &filter); |
| 110 while ((process_entry = it.NextProcessEntry())) |
| 111 result.push_back(process_entry->pid); |
| 112 } |
| 113 #endif // defined(OS_MACOSX) |
| 102 | 114 |
| 103 result.push_back(browser_pid); | 115 result.push_back(browser_pid); |
| 104 | 116 |
| 105 return result; | 117 return result; |
| 106 } | 118 } |
| OLD | NEW |