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 #ifndef CHROME_TEST_CHROME_PROCESS_UTIL_H_ | 5 #ifndef CHROME_TEST_CHROME_PROCESS_UTIL_H_ |
6 #define CHROME_TEST_CHROME_PROCESS_UTIL_H_ | 6 #define CHROME_TEST_CHROME_PROCESS_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/process_util.h" | 12 #include "base/process_util.h" |
13 | 13 |
14 typedef std::vector<base::ProcessId> ChromeProcessList; | 14 typedef std::vector<base::ProcessId> ChromeProcessList; |
15 | 15 |
16 // Returns a vector of PIDs of all chrome processes (main and renderers etc) | 16 // Returns a vector of PIDs of all chrome processes (main and renderers etc) |
17 // based on |browser_pid|, the PID of the main browser process. | 17 // based on |browser_pid|, the PID of the main browser process. |
18 ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid); | 18 ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid); |
19 ChromeProcessList GetRunningChromiumProcesses(base::ProcessId browser_pid); | |
jrt
2011/06/17 19:50:46
Will every call to GetRunningChromeProcess break o
| |
19 | 20 |
20 // Attempts to terminate all chrome processes launched by (and including) | 21 // Attempts to terminate all chrome processes launched by (and including) |
21 // |browser_pid|. | 22 // |browser_pid|. |
22 void TerminateAllChromeProcesses(base::ProcessId browser_pid); | 23 void TerminateAllChromeProcesses(base::ProcessId browser_pid); |
23 | 24 |
24 // A wrapper class for tests to use in fetching process metrics. | 25 // A wrapper class for tests to use in fetching process metrics. |
25 // Delegates everything we need to base::ProcessMetrics, except | 26 // Delegates everything we need to base::ProcessMetrics, except |
26 // memory stats on Mac (which have to parse ps output due to privilege | 27 // memory stats on Mac (which have to parse ps output due to privilege |
27 // restrictions, behavior we don't want in base). Long-term, if | 28 // restrictions, behavior we don't want in base). Long-term, if |
28 // the production base::ProcessMetrics gets updated to return | 29 // the production base::ProcessMetrics gets updated to return |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 | 82 |
82 typedef std::vector<MacChromeProcessInfo> MacChromeProcessInfoList; | 83 typedef std::vector<MacChromeProcessInfo> MacChromeProcessInfoList; |
83 | 84 |
84 // Any ProcessId that info can't be found for will be left out. | 85 // Any ProcessId that info can't be found for will be left out. |
85 MacChromeProcessInfoList GetRunningMacProcessInfo( | 86 MacChromeProcessInfoList GetRunningMacProcessInfo( |
86 const ChromeProcessList& process_list); | 87 const ChromeProcessList& process_list); |
87 | 88 |
88 #endif // defined(OS_MACOSX) | 89 #endif // defined(OS_MACOSX) |
89 | 90 |
90 #endif // CHROME_TEST_CHROME_PROCESS_UTIL_H_ | 91 #endif // CHROME_TEST_CHROME_PROCESS_UTIL_H_ |
OLD | NEW |