summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/task_manager_gtk.cc
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-14 14:02:51 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-14 14:02:51 +0000
commitbdaffe496ea996461e1008be92064236c0201a4c (patch)
treedf917104a81897db626ca6271fe7730f84556995 /chrome/browser/gtk/task_manager_gtk.cc
parentce3eb7b6edbb9fc155a42fab697aeab36f8f40e8 (diff)
downloadchromium_src-bdaffe496ea996461e1008be92064236c0201a4c.zip
chromium_src-bdaffe496ea996461e1008be92064236c0201a4c.tar.gz
chromium_src-bdaffe496ea996461e1008be92064236c0201a4c.tar.bz2
Add to the task manager the v8 column on mac and the javascript column on mac and linux.
BUG=None (js column was added for windows in http://codereview.chromium.org/276009 ), 27226 (v8 column) TEST=Add v8 and javascript columns using the task manager's context menu. should work on all platforms now. Review URL: http://codereview.chromium.org/3419001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59366 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/task_manager_gtk.cc')
-rw-r--r--chrome/browser/gtk/task_manager_gtk.cc21
1 files changed, 20 insertions, 1 deletions
diff --git a/chrome/browser/gtk/task_manager_gtk.cc b/chrome/browser/gtk/task_manager_gtk.cc
index a328101..5259863 100644
--- a/chrome/browser/gtk/task_manager_gtk.cc
+++ b/chrome/browser/gtk/task_manager_gtk.cc
@@ -65,6 +65,7 @@ enum TaskManagerColumn {
kTaskManagerWebCoreImageCache,
kTaskManagerWebCoreScriptsCache,
kTaskManagerWebCoreCssCache,
+ kTaskManagerSqliteMemoryUsed,
kTaskManagerGoatsTeleported,
kTaskManagerColumnCount,
};
@@ -91,6 +92,8 @@ TaskManagerColumn TaskManagerResourceIDToColumnID(int id) {
return kTaskManagerWebCoreScriptsCache;
case IDS_TASK_MANAGER_WEBCORE_CSS_CACHE_COLUMN:
return kTaskManagerWebCoreCssCache;
+ case IDS_TASK_MANAGER_SQLITE_MEMORY_USED_COLUMN:
+ return kTaskManagerSqliteMemoryUsed;
case IDS_TASK_MANAGER_GOATS_TELEPORTED_COLUMN:
return kTaskManagerGoatsTeleported;
default:
@@ -121,6 +124,8 @@ int TaskManagerColumnIDToResourceID(int id) {
return IDS_TASK_MANAGER_WEBCORE_SCRIPTS_CACHE_COLUMN;
case kTaskManagerWebCoreCssCache:
return IDS_TASK_MANAGER_WEBCORE_CSS_CACHE_COLUMN;
+ case kTaskManagerSqliteMemoryUsed:
+ return IDS_TASK_MANAGER_SQLITE_MEMORY_USED_COLUMN;
case kTaskManagerGoatsTeleported:
return IDS_TASK_MANAGER_GOATS_TELEPORTED_COLUMN;
default:
@@ -527,7 +532,8 @@ void TaskManagerGtk::CreateTaskManagerTreeview() {
process_list_ = gtk_list_store_new(kTaskManagerColumnCount,
GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
+ G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+ G_TYPE_STRING);
// Support sorting on all columns.
process_list_sort_ = gtk_tree_model_sort_new_with_model(
@@ -563,6 +569,9 @@ void TaskManagerGtk::CreateTaskManagerTreeview() {
kTaskManagerWebCoreCssCache,
CompareWebCoreCssCache, this, NULL);
gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(process_list_sort_),
+ kTaskManagerSqliteMemoryUsed,
+ CompareSqliteMemoryUsed, this, NULL);
+ gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(process_list_sort_),
kTaskManagerGoatsTeleported,
CompareGoatsTeleported, this, NULL);
treeview_ = gtk_tree_view_new_with_model(process_list_sort_);
@@ -580,6 +589,7 @@ void TaskManagerGtk::CreateTaskManagerTreeview() {
TreeViewInsertColumn(treeview_,
IDS_TASK_MANAGER_WEBCORE_SCRIPTS_CACHE_COLUMN);
TreeViewInsertColumn(treeview_, IDS_TASK_MANAGER_WEBCORE_CSS_CACHE_COLUMN);
+ TreeViewInsertColumn(treeview_, IDS_TASK_MANAGER_SQLITE_MEMORY_USED_COLUMN);
TreeViewInsertColumn(treeview_, IDS_TASK_MANAGER_GOATS_TELEPORTED_COLUMN);
// Hide some columns by default.
@@ -589,6 +599,7 @@ void TaskManagerGtk::CreateTaskManagerTreeview() {
TreeViewColumnSetVisible(treeview_, kTaskManagerWebCoreImageCache, false);
TreeViewColumnSetVisible(treeview_, kTaskManagerWebCoreScriptsCache, false);
TreeViewColumnSetVisible(treeview_, kTaskManagerWebCoreCssCache, false);
+ TreeViewColumnSetVisible(treeview_, kTaskManagerSqliteMemoryUsed, false);
TreeViewColumnSetVisible(treeview_, kTaskManagerGoatsTeleported, false);
g_object_unref(process_list_);
@@ -646,6 +657,9 @@ std::string TaskManagerGtk::GetModelText(int row, int col_id) {
case IDS_TASK_MANAGER_WEBCORE_CSS_CACHE_COLUMN:
return UTF16ToUTF8(model_->GetResourceWebCoreCSSCacheSize(row));
+ case IDS_TASK_MANAGER_SQLITE_MEMORY_USED_COLUMN:
+ return UTF16ToUTF8(model_->GetResourceSqliteMemoryUsed(row));
+
case IDS_TASK_MANAGER_GOATS_TELEPORTED_COLUMN: // Goats Teleported!
return UTF16ToUTF8(model_->GetResourceGoatsTeleported(row));
@@ -695,6 +709,10 @@ void TaskManagerGtk::SetRowDataFromModel(int row, GtkTreeIter* iter) {
if (TreeViewColumnIsVisible(treeview_, kTaskManagerWebCoreCssCache))
wk_css_cache = GetModelText(
row, IDS_TASK_MANAGER_WEBCORE_CSS_CACHE_COLUMN);
+ std::string sqlite_memory;
+ if (TreeViewColumnIsVisible(treeview_, kTaskManagerSqliteMemoryUsed))
+ sqlite_memory = GetModelText(
+ row, IDS_TASK_MANAGER_SQLITE_MEMORY_USED_COLUMN);
std::string goats = GetModelText(
row, IDS_TASK_MANAGER_GOATS_TELEPORTED_COLUMN);
@@ -710,6 +728,7 @@ void TaskManagerGtk::SetRowDataFromModel(int row, GtkTreeIter* iter) {
kTaskManagerWebCoreImageCache, wk_img_cache.c_str(),
kTaskManagerWebCoreScriptsCache, wk_scripts_cache.c_str(),
kTaskManagerWebCoreCssCache, wk_css_cache.c_str(),
+ kTaskManagerSqliteMemoryUsed, sqlite_memory.c_str(),
kTaskManagerGoatsTeleported, goats.c_str(),
-1);
g_object_unref(icon);