diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-02 16:33:24 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-02 16:33:24 +0000 |
commit | 14cb2b2d60200c0f0cdd7d45b9d1bbcbd823207e (patch) | |
tree | 39e51f4bf66c712a8255352102c9124485e249e2 /base/process_util.h | |
parent | 5e7b858fa60f6b50df75a091d1fbbf6ddfae82f4 (diff) | |
download | chromium_src-14cb2b2d60200c0f0cdd7d45b9d1bbcbd823207e.zip chromium_src-14cb2b2d60200c0f0cdd7d45b9d1bbcbd823207e.tar.gz chromium_src-14cb2b2d60200c0f0cdd7d45b9d1bbcbd823207e.tar.bz2 |
CrOS - Add memory consumption status bar widget behind flag
Pass --memory-widget on CrOS to get a real-time display, updated every 5 seconds, of the system's free memory. Tooltip and menu itself detail the data from /proc/meminfo. Also made base::GetSystemMemoryInfo() available on Linux systems to provide detailed data.
BUG=chromium-os:18446
TEST=manual
Review URL: http://codereview.chromium.org/7518010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95089 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util.h')
-rw-r--r-- | base/process_util.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/base/process_util.h b/base/process_util.h index 3d9b7d1..5f88c62 100644 --- a/base/process_util.h +++ b/base/process_util.h @@ -653,7 +653,14 @@ class BASE_API ProcessMetrics { DISALLOW_COPY_AND_ASSIGN(ProcessMetrics); }; -// Returns the memory commited by the system in KBytes. +#if defined(OS_LINUX) +// Retrieves data from /proc/meminfo about system-wide memory consumption. +// Values are in KB. Returns true on success. +BASE_API bool GetSystemMemoryInfo(int* total_kb, int* free_kb, int* buffers_kb, + int* cache_kb, int* shmem_kb); +#endif + +// Returns the memory committed by the system in KBytes. // Returns 0 if it can't compute the commit charge. BASE_API size_t GetSystemCommitCharge(); |