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

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

Issue 403018: linux: use /proc/self/exe when exec'ing ourselves (Closed)
Patch Set: fixed test Created 11 years, 1 month 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
« 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // defined(OS_LINUX) 101 #endif // defined(OS_LINUX)
102 102
103 #if defined(OS_MACOSX) 103 #if defined(OS_LINUX) || defined(OS_MACOSX)
104 // On Mac OS X we run the subprocesses with a different bundle, so they end 104 // On Mac OS X we run the subprocesses with a different bundle, and
105 // up with a different name, so we have to collect them in a second pass. 105 // on Linux via /proc/self/exe, so they end up with a different
106 // name. We must collect them in a second pass.
106 { 107 {
107 ChildProcessFilter filter(browser_pid); 108 ChildProcessFilter filter(browser_pid);
108 base::NamedProcessIterator it(chrome::kHelperProcessExecutableName, 109 base::NamedProcessIterator it(chrome::kHelperProcessExecutableName,
109 &filter); 110 &filter);
110 while ((process_entry = it.NextProcessEntry())) 111 while ((process_entry = it.NextProcessEntry()))
111 result.push_back(process_entry->pid); 112 result.push_back(process_entry->pid);
112 } 113 }
113 #endif // defined(OS_MACOSX) 114 #endif // defined(OS_MACOSX)
114 115
115 result.push_back(browser_pid); 116 result.push_back(browser_pid);
116 117
117 return result; 118 return result;
118 } 119 }
119 120
120 #if !defined(OS_MACOSX) 121 #if !defined(OS_MACOSX)
121 122
122 size_t ChromeTestProcessMetrics::GetPagefileUsage() { 123 size_t ChromeTestProcessMetrics::GetPagefileUsage() {
123 return process_metrics_->GetPagefileUsage(); 124 return process_metrics_->GetPagefileUsage();
124 } 125 }
125 126
126 size_t ChromeTestProcessMetrics::GetWorkingSetSize() { 127 size_t ChromeTestProcessMetrics::GetWorkingSetSize() {
127 return process_metrics_->GetWorkingSetSize(); 128 return process_metrics_->GetWorkingSetSize();
128 } 129 }
129 130
130 #endif // !defined(OS_MACOSX) 131 #endif // !defined(OS_MACOSX)
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