summaryrefslogtreecommitdiffstats
path: root/chrome/browser/task_manager_resource_providers.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-30 18:28:44 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-30 18:28:44 +0000
commit149fd6df098f406fcb8bcabc12c9a8fefda49058 (patch)
treee7b1838eb63d9ba7883cc8c2c85fdde6a84a1759 /chrome/browser/task_manager_resource_providers.cc
parentadeedaff76d28c2dd2c75bd399dbae21c415d037 (diff)
downloadchromium_src-149fd6df098f406fcb8bcabc12c9a8fefda49058.zip
chromium_src-149fd6df098f406fcb8bcabc12c9a8fefda49058.tar.gz
chromium_src-149fd6df098f406fcb8bcabc12c9a8fefda49058.tar.bz2
Make it possible to sort the WebCore Cache size columns in the Task Manager. Also only show cache sizes once per process since the WebCore Cahce is a singleton within the renderer process.
BUG=16221 TEST=none Review URL: http://codereview.chromium.org/244041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27636 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/task_manager_resource_providers.cc')
-rw-r--r--chrome/browser/task_manager_resource_providers.cc29
1 files changed, 3 insertions, 26 deletions
diff --git a/chrome/browser/task_manager_resource_providers.cc b/chrome/browser/task_manager_resource_providers.cc
index 8899463..20ef4d1a 100644
--- a/chrome/browser/task_manager_resource_providers.cc
+++ b/chrome/browser/task_manager_resource_providers.cc
@@ -85,36 +85,13 @@ std::wstring TaskManagerTabContentsResource::GetTitle() const {
return l10n_util::GetStringF(IDS_TASK_MANAGER_TAB_PREFIX, tab_title);
}
-std::wstring FormatStatsSize(const WebKit::WebCache::ResourceTypeStat& stat) {
- std::wstring size = FormatBytes(stat.size, DATA_UNITS_KILOBYTE, false);
- std::wstring live_size = FormatBytes(stat.liveSize,
- DATA_UNITS_KILOBYTE,
- false);
- return l10n_util::GetStringF(IDS_TASK_MANAGER_CACHE_SIZE_CELL_TEXT,
- size,
- live_size);
-}
-
-void TaskManagerTabContentsResource::UpdateResourceStats() {
+WebKit::WebCache::ResourceTypeStats
+ TaskManagerTabContentsResource::GetWebCoreCacheStats() const {
if (!pending_stats_update_) {
tab_contents_->render_view_host()->Send(new ViewMsg_GetCacheResourceStats);
pending_stats_update_ = true;
}
-}
-
-std::wstring TaskManagerTabContentsResource::GetWebCoreImageCacheSize() {
- UpdateResourceStats();
- return FormatStatsSize(stats_.images);
-}
-
-std::wstring TaskManagerTabContentsResource::GetWebCoreScriptsCacheSize() {
- UpdateResourceStats();
- return FormatStatsSize(stats_.scripts);
-}
-
-std::wstring TaskManagerTabContentsResource::GetWebCoreCSSCacheSize() {
- UpdateResourceStats();
- return FormatStatsSize(stats_.cssStyleSheets);
+ return stats_;
}
void TaskManagerTabContentsResource::NotifyResourceTypeStats(