summaryrefslogtreecommitdiffstats
path: root/chrome/browser/memory_details.h
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 23:37:40 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 23:37:40 +0000
commitf164cea41472f9e9ec21579233e2c42a7b9d5184 (patch)
tree523c6aa180be86ace3ac7797e4c9c75c369dff57 /chrome/browser/memory_details.h
parent422c0f17466cddf30fd6815f9d3519a3815264c6 (diff)
downloadchromium_src-f164cea41472f9e9ec21579233e2c42a7b9d5184.zip
chromium_src-f164cea41472f9e9ec21579233e2c42a7b9d5184.tar.gz
chromium_src-f164cea41472f9e9ec21579233e2c42a7b9d5184.tar.bz2
Mac: Implement about:memory.
This implements about:memory on Mac. It calls /bin/ps to obtain information about processes (this is Apple's officially supported "API"). Unfortunately, ps provides fairly minimal information (rss and vsize); top is better, but not a stable API -- it has changed greatly between Mac OS 10.5 and 10.6, and moreover the 10.6 version is more limited in its output formatting. BUG=9653 TEST=Go to about:memory under a variety of conditions (with a variety of browsers loaded). Review URL: http://codereview.chromium.org/333008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31168 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/memory_details.h')
-rw-r--r--chrome/browser/memory_details.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/memory_details.h b/chrome/browser/memory_details.h
index b92fbae..0b35b4e 100644
--- a/chrome/browser/memory_details.h
+++ b/chrome/browser/memory_details.h
@@ -52,6 +52,10 @@ struct ProcessData {
ProcessMemoryInformationList processes;
};
+#if defined(OS_MACOSX)
+class ProcessInfoSnapshot;
+#endif
+
// MemoryDetails fetches memory details about current running browsers.
// Because this data can only be fetched asynchronously, callers use
// this class via a callback.
@@ -103,6 +107,16 @@ class MemoryDetails : public base::RefCountedThreadSafe<MemoryDetails> {
// The parameter holds information about processes from the IO thread.
void CollectProcessData(std::vector<ProcessMemoryInformation>);
+#if defined(OS_MACOSX)
+ // A helper for |CollectProcessData()|, collecting data on the Chrome/Chromium
+ // process with PID |pid|. The collected data is added to the state of the
+ // object (in |process_data_|).
+ void CollectProcessDataChrome(
+ const std::vector<ProcessMemoryInformation>& child_info,
+ base::ProcessId pid,
+ const ProcessInfoSnapshot& process_info);
+#endif
+
// Collect child process information on the UI thread. Information about
// renderer processes is only available there.
void CollectChildInfoOnUIThread();