| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_TASK_MANAGER_RENDERER_RESOURCE_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGER_RENDERER_RESOURCE_H_ |
| 6 #define CHROME_BROWSER_TASK_MANAGER_RENDERER_RESOURCE_H_ | 6 #define CHROME_BROWSER_TASK_MANAGER_RENDERER_RESOURCE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "chrome/browser/task_manager/resource_provider.h" | 9 #include "chrome/browser/task_manager/resource_provider.h" |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 content::RenderViewHost* render_view_host); | 22 content::RenderViewHost* render_view_host); |
| 23 virtual ~RendererResource(); | 23 virtual ~RendererResource(); |
| 24 | 24 |
| 25 // Resource methods: | 25 // Resource methods: |
| 26 virtual base::ProcessHandle GetProcess() const OVERRIDE; | 26 virtual base::ProcessHandle GetProcess() const OVERRIDE; |
| 27 virtual int GetUniqueChildProcessId() const OVERRIDE; | 27 virtual int GetUniqueChildProcessId() const OVERRIDE; |
| 28 virtual Type GetType() const OVERRIDE; | 28 virtual Type GetType() const OVERRIDE; |
| 29 virtual int GetRoutingID() const OVERRIDE; | 29 virtual int GetRoutingID() const OVERRIDE; |
| 30 | 30 |
| 31 virtual bool ReportsCacheStats() const OVERRIDE; | 31 virtual bool ReportsCacheStats() const OVERRIDE; |
| 32 virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const | 32 virtual blink::WebCache::ResourceTypeStats GetWebCoreCacheStats() const |
| 33 OVERRIDE; | 33 OVERRIDE; |
| 34 virtual bool ReportsFPS() const OVERRIDE; | 34 virtual bool ReportsFPS() const OVERRIDE; |
| 35 virtual float GetFPS() const OVERRIDE; | 35 virtual float GetFPS() const OVERRIDE; |
| 36 virtual bool ReportsV8MemoryStats() const OVERRIDE; | 36 virtual bool ReportsV8MemoryStats() const OVERRIDE; |
| 37 virtual size_t GetV8MemoryAllocated() const OVERRIDE; | 37 virtual size_t GetV8MemoryAllocated() const OVERRIDE; |
| 38 virtual size_t GetV8MemoryUsed() const OVERRIDE; | 38 virtual size_t GetV8MemoryUsed() const OVERRIDE; |
| 39 | 39 |
| 40 // RenderResources are always inspectable. | 40 // RenderResources are always inspectable. |
| 41 virtual bool CanInspect() const OVERRIDE; | 41 virtual bool CanInspect() const OVERRIDE; |
| 42 virtual void Inspect() const OVERRIDE; | 42 virtual void Inspect() const OVERRIDE; |
| 43 | 43 |
| 44 // RenderResources always provide the network usage. | 44 // RenderResources always provide the network usage. |
| 45 virtual bool SupportNetworkUsage() const OVERRIDE; | 45 virtual bool SupportNetworkUsage() const OVERRIDE; |
| 46 virtual void SetSupportNetworkUsage() OVERRIDE { } | 46 virtual void SetSupportNetworkUsage() OVERRIDE { } |
| 47 | 47 |
| 48 virtual void Refresh() OVERRIDE; | 48 virtual void Refresh() OVERRIDE; |
| 49 | 49 |
| 50 virtual void NotifyResourceTypeStats( | 50 virtual void NotifyResourceTypeStats( |
| 51 const WebKit::WebCache::ResourceTypeStats& stats) OVERRIDE; | 51 const blink::WebCache::ResourceTypeStats& stats) OVERRIDE; |
| 52 | 52 |
| 53 virtual void NotifyFPS(float fps) OVERRIDE; | 53 virtual void NotifyFPS(float fps) OVERRIDE; |
| 54 | 54 |
| 55 virtual void NotifyV8HeapStats(size_t v8_memory_allocated, | 55 virtual void NotifyV8HeapStats(size_t v8_memory_allocated, |
| 56 size_t v8_memory_used) OVERRIDE; | 56 size_t v8_memory_used) OVERRIDE; |
| 57 | 57 |
| 58 content::RenderViewHost* render_view_host() const { | 58 content::RenderViewHost* render_view_host() const { |
| 59 return render_view_host_; | 59 return render_view_host_; |
| 60 } | 60 } |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 base::ProcessHandle process_; | 63 base::ProcessHandle process_; |
| 64 int pid_; | 64 int pid_; |
| 65 int unique_process_id_; | 65 int unique_process_id_; |
| 66 | 66 |
| 67 // RenderViewHost we use to fetch stats. | 67 // RenderViewHost we use to fetch stats. |
| 68 content::RenderViewHost* render_view_host_; | 68 content::RenderViewHost* render_view_host_; |
| 69 // The stats_ field holds information about resource usage in the renderer | 69 // The stats_ field holds information about resource usage in the renderer |
| 70 // process and so it is updated asynchronously by the Refresh() call. | 70 // process and so it is updated asynchronously by the Refresh() call. |
| 71 WebKit::WebCache::ResourceTypeStats stats_; | 71 blink::WebCache::ResourceTypeStats stats_; |
| 72 // This flag is true if we are waiting for the renderer to report its stats. | 72 // This flag is true if we are waiting for the renderer to report its stats. |
| 73 bool pending_stats_update_; | 73 bool pending_stats_update_; |
| 74 | 74 |
| 75 // The fps_ field holds the renderer frames per second. | 75 // The fps_ field holds the renderer frames per second. |
| 76 float fps_; | 76 float fps_; |
| 77 // This flag is true if we are waiting for the renderer to report its FPS. | 77 // This flag is true if we are waiting for the renderer to report its FPS. |
| 78 bool pending_fps_update_; | 78 bool pending_fps_update_; |
| 79 | 79 |
| 80 // We do a similar dance to gather the V8 memory usage in a process. | 80 // We do a similar dance to gather the V8 memory usage in a process. |
| 81 size_t v8_memory_allocated_; | 81 size_t v8_memory_allocated_; |
| 82 size_t v8_memory_used_; | 82 size_t v8_memory_used_; |
| 83 bool pending_v8_memory_allocated_update_; | 83 bool pending_v8_memory_allocated_update_; |
| 84 | 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(RendererResource); | 85 DISALLOW_COPY_AND_ASSIGN(RendererResource); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace task_manager | 88 } // namespace task_manager |
| 89 | 89 |
| 90 #endif // CHROME_BROWSER_TASK_MANAGER_RENDERER_RESOURCE_H_ | 90 #endif // CHROME_BROWSER_TASK_MANAGER_RENDERER_RESOURCE_H_ |
| OLD | NEW |