summaryrefslogtreecommitdiffstats
path: root/chrome/browser/task_manager.h
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 17:59:03 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 17:59:03 +0000
commitec9773681c979a58f966d6cb0fc8ad16746e3adf (patch)
tree2cbc893a1d4eb757b5bc9691351419d2eeceb007 /chrome/browser/task_manager.h
parent1224e328aa1210ed5c194a5626479ac15519f3af (diff)
downloadchromium_src-ec9773681c979a58f966d6cb0fc8ad16746e3adf.zip
chromium_src-ec9773681c979a58f966d6cb0fc8ad16746e3adf.tar.gz
chromium_src-ec9773681c979a58f966d6cb0fc8ad16746e3adf.tar.bz2
Adds three new off-by-default columns to the task manager to track WebCore caches
These values are currently exposed via about:histograms/WebCoreCache. This change allows for users to monitor the cache sizes in real-time broken out by renderer. TEST=Open task manager, right click on chrome, select columns, observe that they update along with browsing. BUG=16221 Review URL: http://codereview.chromium.org/217010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27216 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/task_manager.h')
-rw-r--r--chrome/browser/task_manager.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/task_manager.h b/chrome/browser/task_manager.h
index 811cf2f..7c1e67e 100644
--- a/chrome/browser/task_manager.h
+++ b/chrome/browser/task_manager.h
@@ -21,6 +21,7 @@
#include "chrome/browser/tab_contents/tab_contents.h"
#include "net/url_request/url_request_job_tracker.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
+#include "webkit/api/public/WebCache.h"
class MessageLoop;
class SkBitmap;
@@ -46,6 +47,10 @@ class TaskManager {
virtual SkBitmap GetIcon() const = 0;
virtual base::ProcessHandle GetProcess() const = 0;
+ virtual std::wstring GetWebCoreImageCacheSize();
+ virtual std::wstring GetWebCoreScriptsCacheSize();
+ virtual std::wstring GetWebCoreCSSCacheSize();
+
// A helper function for ActivateFocusedTab. Returns NULL by default
// because not all resources have an assoiciated tab.
virtual TabContents* GetTabContents() const {return NULL;}
@@ -60,6 +65,9 @@ class TaskManager {
// Called when some bytes have been read and support_network_usage returns
// false (meaning we do have network usage support).
virtual void SetSupportNetworkUsage() = 0;
+
+ virtual void NotifyResourceTypeStats(
+ const WebKit::WebCache::ResourceTypeStats& stats) {}
};
// ResourceProviders are responsible for adding/removing resources to the task
@@ -172,6 +180,9 @@ class TaskManagerModel : public URLRequestJobTracker::JobObserver,
std::wstring GetResourcePhysicalMemory(int index) const;
std::wstring GetResourceProcessId(int index) const;
std::wstring GetResourceStatsValue(int index, int col_id) const;
+ std::wstring GetResourceWebCoreImageCacheSize(int index) const;
+ std::wstring GetResourceWebCoreScriptsCacheSize(int index) const;
+ std::wstring GetResourceWebCoreCSSCacheSize(int index) const;
std::wstring GetResourceGoatsTeleported(int index) const;
// Returns true if the resource is first in its group (resources
@@ -213,6 +224,10 @@ class TaskManagerModel : public URLRequestJobTracker::JobObserver,
void Clear(); // Removes all items.
+ void NotifyResourceTypeStats(
+ base::ProcessId renderer_handle,
+ const WebKit::WebCache::ResourceTypeStats& stats);
+
private:
enum UpdateState {
IDLE = 0, // Currently not updating.