diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-27 01:30:57 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-27 01:30:57 +0000 |
commit | 99e9d796bb22f7a87fae907311f491b2ed02dfb6 (patch) | |
tree | bedbcf4f6315958cd54bd891af5582d3bccea610 /chrome/browser/task_manager.h | |
parent | 75c99878c8f219b25f5d8e21b79dc4208d327824 (diff) | |
download | chromium_src-99e9d796bb22f7a87fae907311f491b2ed02dfb6.zip chromium_src-99e9d796bb22f7a87fae907311f491b2ed02dfb6.tar.gz chromium_src-99e9d796bb22f7a87fae907311f491b2ed02dfb6.tar.bz2 |
Make the memory resource functions return bools so that we know when the information is not available. Refactor TaskManager slightly.
BUG=23366
TEST=See "N/A" for memory usage in Linux task manager
Review URL: http://codereview.chromium.org/339012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30148 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/task_manager.h')
-rw-r--r-- | chrome/browser/task_manager.h | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/chrome/browser/task_manager.h b/chrome/browser/task_manager.h index 0425c11..b00d190 100644 --- a/chrome/browser/task_manager.h +++ b/chrome/browser/task_manager.h @@ -313,28 +313,26 @@ class TaskManagerModel : public URLRequestJobTracker::JobObserver, // |resource|. int GetCPUUsage(TaskManager::Resource* resource) const; - // Retrieves the private memory (in KB) that should be displayed from the - // passed |process_metrics|. - size_t GetPrivateMemory(const base::ProcessMetrics* process_metrics) const; + // Gets the private memory (in KB) that should be displayed for the passed + // resource index. + bool GetPrivateMemory(int index, size_t* result) const; - // Returns the shared memory (in KB) that should be displayed from the passed - // |process_metrics|. - size_t GetSharedMemory(const base::ProcessMetrics* process_metrics) const; + // Gets the shared memory (in KB) that should be displayed for the passed + // resource index. + bool GetSharedMemory(int index, size_t* result) const; - // Returns the pysical memory (in KB) that should be displayed from the passed - // |process_metrics|. - size_t GetPhysicalMemory(const base::ProcessMetrics* process_metrics) const; + // Gets the physical memory (in KB) that should be displayed for the passed + // resource index. + bool GetPhysicalMemory(int index, size_t* result) const; // Returns the stat value at the column |col_id| that should be displayed from // the passed |process_metrics|. int GetStatsValue(const TaskManager::Resource* resource, int col_id) const; - // Retrieves the ProcessMetrics for the resources at the specified rows. - // Returns true if there was a ProcessMetrics available for both rows. - bool GetProcessMetricsForRows(int row1, - int row2, - base::ProcessMetrics** proc_metrics1, - base::ProcessMetrics** proc_metrics2) const; + // Retrieves the ProcessMetrics for the resources at the specified row. + // Returns true if there was a ProcessMetrics available. + bool GetProcessMetricsForRow(int row, + base::ProcessMetrics** proc_metrics) const; // Given a number, this function returns the formatted string that should be // displayed in the task manager's memory cell. |