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

Side by Side Diff: chrome/test/chrome_process_util.cc

Issue 165531: Fix up the pid collection code for Mac OS X so it handles the different bundl... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 4 months 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/chrome_constants.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/common/chrome_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698