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_resource_providers.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_resource_providers.h')
-rw-r--r-- | chrome/browser/task_manager_resource_providers.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/chrome/browser/task_manager_resource_providers.h b/chrome/browser/task_manager_resource_providers.h index ae3bf100..b374a65 100644 --- a/chrome/browser/task_manager_resource_providers.h +++ b/chrome/browser/task_manager_resource_providers.h @@ -35,6 +35,10 @@ class TaskManagerTabContentsResource : public TaskManager::Resource { virtual bool ReportsCacheStats() const { return true; } virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const; + virtual bool ReportsV8MemoryStats() const { return true; } + virtual size_t GetV8MemoryAllocated() const; + virtual size_t GetV8MemoryUsed() const; + // TabContents always provide the network usage. bool SupportNetworkUsage() const { return true; } void SetSupportNetworkUsage() { } @@ -44,18 +48,24 @@ class TaskManagerTabContentsResource : public TaskManager::Resource { virtual void NotifyResourceTypeStats( const WebKit::WebCache::ResourceTypeStats& stats); + virtual void NotifyV8HeapStats(size_t v8_memory_allocated, + size_t v8_memory_used); + private: TabContents* tab_contents_; base::ProcessHandle process_; int pid_; // The stats_ field holds information about resource usage in the renderer - // process and so it is updated asynchronously. A query to any of the - // GetWebCore*CacheSize() functions will send an IPC to the renderer asking - // for an update unless a query is already outstanding. + // process and so it is updated asynchronously by the Refresh() call. WebKit::WebCache::ResourceTypeStats stats_; // This flag is true if we are waiting for the renderer to report its stats. bool pending_stats_update_; + // We do a similar dance to gather the V8 memory usage in a process. + size_t v8_memory_allocated_; + size_t v8_memory_used_; + bool pending_v8_memory_allocated_update_; + DISALLOW_COPY_AND_ASSIGN(TaskManagerTabContentsResource); }; |