diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-29 17:44:42 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-29 17:44:42 +0000 |
commit | b6128aaba9e7c148d1a71710b1d7de5d101f9967 (patch) | |
tree | dca19e0d51b91edcd5e2203de2f3158c64bcdb5c /chrome/test/chrome_process_util.cc | |
parent | a65b0ba084b3b197f817b88bd21b275e1790a629 (diff) | |
download | chromium_src-b6128aaba9e7c148d1a71710b1d7de5d101f9967.zip chromium_src-b6128aaba9e7c148d1a71710b1d7de5d101f9967.tar.gz chromium_src-b6128aaba9e7c148d1a71710b1d7de5d101f9967.tar.bz2 |
Move common code into process_util.cc.
Fix namespace usage.
Change ProcessEntry to have a common interface accross platforms and change ProcessFilter::Includes() to make use of it.
Split NamedProcessIterator in two.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1689012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45953 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/chrome_process_util.cc')
-rw-r--r-- | chrome/test/chrome_process_util.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/chrome/test/chrome_process_util.cc b/chrome/test/chrome_process_util.cc index 5f47df0..8e86e60 100644 --- a/chrome/test/chrome_process_util.cc +++ b/chrome/test/chrome_process_util.cc @@ -58,8 +58,8 @@ class ChildProcessFilter : public base::ProcessFilter { explicit ChildProcessFilter(std::vector<base::ProcessId> parent_pids) : parent_pids_(parent_pids.begin(), parent_pids.end()) {} - virtual bool Includes(base::ProcessId pid, base::ProcessId parent_pid) const { - return parent_pids_.find(parent_pid) != parent_pids_.end(); + virtual bool Includes(const base::ProcessEntry& entry) const { + return parent_pids_.find(entry.parent_pid()) != parent_pids_.end(); } private: @@ -76,11 +76,7 @@ ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid) { ChildProcessFilter filter(browser_pid); base::NamedProcessIterator it(chrome::kBrowserProcessExecutableName, &filter); while (const base::ProcessEntry* process_entry = it.NextProcessEntry()) { -#if defined(OS_WIN) - result.push_back(process_entry->th32ProcessID); -#elif defined(OS_POSIX) - result.push_back(process_entry->pid); -#endif + result.push_back(process_entry->pid()); } #if defined(OS_LINUX) @@ -92,7 +88,7 @@ ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid) { base::NamedProcessIterator it(chrome::kBrowserProcessExecutableName, &filter); while (const base::ProcessEntry* process_entry = it.NextProcessEntry()) - result.push_back(process_entry->pid); + result.push_back(process_entry->pid()); } #endif // defined(OS_LINUX) @@ -105,7 +101,7 @@ ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid) { base::NamedProcessIterator it(chrome::kHelperProcessExecutableName, &filter); while (const base::ProcessEntry* process_entry = it.NextProcessEntry()) - result.push_back(process_entry->pid); + result.push_back(process_entry->pid()); } #endif // defined(OS_MACOSX) |