diff options
author | jbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-26 20:20:50 +0000 |
---|---|---|
committer | jbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-26 20:20:50 +0000 |
commit | 872ae5b43c6acaf54f2622ace41fcd32eb05adbb (patch) | |
tree | 15ae5b748b0e2df936afb6d269551b08cf246814 /chrome/browser/task_manager/task_manager.cc | |
parent | dd0b31085b4ecbb1faf61171cf882316c0a02792 (diff) | |
download | chromium_src-872ae5b43c6acaf54f2622ace41fcd32eb05adbb.zip chromium_src-872ae5b43c6acaf54f2622ace41fcd32eb05adbb.tar.gz chromium_src-872ae5b43c6acaf54f2622ace41fcd32eb05adbb.tar.bz2 |
Add FPS column to Task Manager.
BUG=73206
TEST=open task manager and view FPS column.
Review URL: http://codereview.chromium.org/7063014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86887 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/task_manager/task_manager.cc')
-rw-r--r-- | chrome/browser/task_manager/task_manager.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc index b8fee16..61166ea 100644 --- a/chrome/browser/task_manager/task_manager.cc +++ b/chrome/browser/task_manager/task_manager.cc @@ -213,6 +213,15 @@ string16 TaskManagerModel::GetResourceWebCoreCSSCacheSize( return FormatStatsSize(stats.cssStyleSheets); } +string16 TaskManagerModel::GetResourceFPS( + int index) const { + CHECK_LT(index, ResourceCount()); + if (!resources_[index]->ReportsFPS()) + return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT); + double fps = resources_[index]->GetFPS(); + return UTF8ToUTF16(base::StringPrintf("%.0f", fps)); +} + string16 TaskManagerModel::GetResourceSqliteMemoryUsed(int index) const { CHECK_LT(index, ResourceCount()); if (!resources_[index]->ReportsSqliteMemoryUsed()) @@ -348,6 +357,9 @@ int TaskManagerModel::CompareValues(int row1, int row2, int col_id) const { DCHECK_EQ(IDS_TASK_MANAGER_WEBCORE_CSS_CACHE_COLUMN, col_id); return ValueCompare<size_t>(stats1.cssStyleSheets.size, stats2.cssStyleSheets.size); + } else if (col_id == IDS_TASK_MANAGER_FPS_COLUMN) { + return ValueCompare<float>(resources_[row1]->GetFPS(), + resources_[row2]->GetFPS()); } else if (col_id == IDS_TASK_MANAGER_GOATS_TELEPORTED_COLUMN) { return ValueCompare<int>(GetGoatsTeleported(row1), GetGoatsTeleported(row2)); @@ -678,6 +690,18 @@ void TaskManagerModel::NotifyResourceTypeStats( } } +void TaskManagerModel::NotifyFPS(base::ProcessId renderer_id, + int routing_id, + float fps) { + for (ResourceList::iterator it = resources_.begin(); + it != resources_.end(); ++it) { + if (base::GetProcId((*it)->GetProcess()) == renderer_id && + (*it)->GetRoutingId() == routing_id) { + (*it)->NotifyFPS(fps); + } + } +} + void TaskManagerModel::NotifyV8HeapStats(base::ProcessId renderer_id, size_t v8_memory_allocated, size_t v8_memory_used) { |