diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-11 01:51:32 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-11 01:51:32 +0000 |
commit | 38b48a844731cd10d69d8e99d476e3dac9e81980 (patch) | |
tree | b73cc4ca2cae009276db4305eac119d080f0381f /chrome/browser/task_manager.h | |
parent | 5ecc992a4bf8546b21db89901f2d87e8b4ae1a94 (diff) | |
download | chromium_src-38b48a844731cd10d69d8e99d476e3dac9e81980.zip chromium_src-38b48a844731cd10d69d8e99d476e3dac9e81980.tar.gz chromium_src-38b48a844731cd10d69d8e99d476e3dac9e81980.tar.bz2 |
Adds a 'V8' column to task manager to track amount of memory in JavaScript heap
BUG=27226
TEST=open task manager, enable column, compare with V8 heap profiler
Review URL: http://codereview.chromium.org/377037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31641 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/task_manager.h')
-rw-r--r-- | chrome/browser/task_manager.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/chrome/browser/task_manager.h b/chrome/browser/task_manager.h index 9fa19f6..2c76a7d 100644 --- a/chrome/browser/task_manager.h +++ b/chrome/browser/task_manager.h @@ -59,6 +59,10 @@ class TaskManager { // if not applicable. virtual const Extension* GetExtension() const { return NULL; } + virtual bool ReportsV8MemoryStats() const { return false; } + virtual size_t GetV8MemoryAllocated() const { return 0; } + virtual size_t GetV8MemoryUsed() const { return 0; } + // A helper function for ActivateFocusedTab. Returns NULL by default // because not all resources have an associated tab. virtual TabContents* GetTabContents() const { return NULL; } @@ -80,6 +84,8 @@ class TaskManager { virtual void NotifyResourceTypeStats( const WebKit::WebCache::ResourceTypeStats& stats) {} + virtual void NotifyV8HeapStats(size_t v8_memory_allocated, + size_t v8_memory_used) {} }; // ResourceProviders are responsible for adding/removing resources to the task @@ -202,6 +208,7 @@ class TaskManagerModel : public URLRequestJobTracker::JobObserver, std::wstring GetResourceWebCoreCSSCacheSize(int index) const; std::wstring GetResourceSqliteMemoryUsed(int index) const; std::wstring GetResourceGoatsTeleported(int index) const; + std::wstring GetResourceV8MemoryAllocatedSize(int index) const; // Returns true if the resource is first in its group (resources // rendered by the same process are groupped together). @@ -246,9 +253,13 @@ class TaskManagerModel : public URLRequestJobTracker::JobObserver, void Clear(); // Removes all items. void NotifyResourceTypeStats( - base::ProcessId renderer_handle, + base::ProcessId renderer_id, const WebKit::WebCache::ResourceTypeStats& stats); + void NotifyV8HeapStats(base::ProcessId renderer_id, + size_t v8_memory_allocated, + size_t v8_memory_used); + private: friend class base::RefCountedThreadSafe<TaskManagerModel>; FRIEND_TEST(TaskManagerTest, RefreshCalled); |