diff options
author | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-17 18:23:25 +0000 |
---|---|---|
committer | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-17 18:23:25 +0000 |
commit | 95c1aac9bbd395e30fb4003d947f3f61089d6312 (patch) | |
tree | c50c31f0e1f9dad1fc306efaf07db1112e4f854d /chrome/test/chrome_process_util.h | |
parent | a7281024bc3adc15e818ed641acca01507130342 (diff) | |
download | chromium_src-95c1aac9bbd395e30fb4003d947f3f61089d6312.zip chromium_src-95c1aac9bbd395e30fb4003d947f3f61089d6312.tar.gz chromium_src-95c1aac9bbd395e30fb4003d947f3f61089d6312.tar.bz2 |
Add a helper on mac for collecting memory size info from a list of processes.
Spawn PS to collect the data and parse the output.
Add ifdef checks in the page cyclers so on mac we can use the other helper since base methods can't ever be made to work.
BUG=none
TEST=memory info should now show in the waterfall and on the perf graphs for the page cycler tests.
Review URL: http://codereview.chromium.org/125254
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18635 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/chrome_process_util.h')
-rw-r--r-- | chrome/test/chrome_process_util.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/chrome/test/chrome_process_util.h b/chrome/test/chrome_process_util.h index 31f3b5f..576c2e0 100644 --- a/chrome/test/chrome_process_util.h +++ b/chrome/test/chrome_process_util.h @@ -23,4 +23,29 @@ ChromeProcessList GetRunningChromeProcesses(const FilePath& data_dir); // Attempts to terminate all chrome processes associated with |data_dir|. void TerminateAllChromeProcesses(const FilePath& data_dir); +#if defined(OS_MACOSX) + +// These types and API are here to fetch the information about a set of running +// processes by ID on the Mac. There are also APIs in base, but fetching the +// information for another process requires privileges that a normal executable +// does not have. This API fetches the data by spawning ps (which is setuid so +// it has the needed privileges) and processing its output. The API is provided +// here because we don't want code spawning processes like this in base, where +// someone writing cross platform code might use it without realizing that it's +// a heavyweight call on the Mac. + +struct MacChromeProcessInfo { + base::ProcessId pid; + int rsz_in_kb; + int vsz_in_kb; +}; + +typedef std::vector<MacChromeProcessInfo> MacChromeProcessInfoList; + +// Any ProcessId that info can't be found for will be left out. +MacChromeProcessInfoList GetRunningMacProcessInfo( + const ChromeProcessList &process_list); + +#endif // defined(OS_MACOSX) + #endif // CHROME_TEST_CHROME_PROCESS_UTIL_H_ |