| 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 14 matching lines...) Expand all Loading... |
| 25 // Resource methods: | 25 // Resource methods: |
| 26 virtual base::string16 GetProfileName() const OVERRIDE; | 26 virtual base::string16 GetProfileName() const OVERRIDE; |
| 27 virtual base::ProcessHandle GetProcess() const OVERRIDE; | 27 virtual base::ProcessHandle GetProcess() const OVERRIDE; |
| 28 virtual int GetUniqueChildProcessId() const OVERRIDE; | 28 virtual int GetUniqueChildProcessId() const OVERRIDE; |
| 29 virtual Type GetType() const OVERRIDE; | 29 virtual Type GetType() const OVERRIDE; |
| 30 virtual int GetRoutingID() const OVERRIDE; | 30 virtual int GetRoutingID() const OVERRIDE; |
| 31 | 31 |
| 32 virtual bool ReportsCacheStats() const OVERRIDE; | 32 virtual bool ReportsCacheStats() const OVERRIDE; |
| 33 virtual blink::WebCache::ResourceTypeStats GetWebCoreCacheStats() const | 33 virtual blink::WebCache::ResourceTypeStats GetWebCoreCacheStats() const |
| 34 OVERRIDE; | 34 OVERRIDE; |
| 35 virtual bool ReportsFPS() const OVERRIDE; | |
| 36 virtual float GetFPS() const OVERRIDE; | |
| 37 virtual bool ReportsV8MemoryStats() const OVERRIDE; | 35 virtual bool ReportsV8MemoryStats() const OVERRIDE; |
| 38 virtual size_t GetV8MemoryAllocated() const OVERRIDE; | 36 virtual size_t GetV8MemoryAllocated() const OVERRIDE; |
| 39 virtual size_t GetV8MemoryUsed() const OVERRIDE; | 37 virtual size_t GetV8MemoryUsed() const OVERRIDE; |
| 40 | 38 |
| 41 // RenderResources are always inspectable. | 39 // RenderResources are always inspectable. |
| 42 virtual bool CanInspect() const OVERRIDE; | 40 virtual bool CanInspect() const OVERRIDE; |
| 43 virtual void Inspect() const OVERRIDE; | 41 virtual void Inspect() const OVERRIDE; |
| 44 | 42 |
| 45 // RenderResources always provide the network usage. | 43 // RenderResources always provide the network usage. |
| 46 virtual bool SupportNetworkUsage() const OVERRIDE; | 44 virtual bool SupportNetworkUsage() const OVERRIDE; |
| 47 virtual void SetSupportNetworkUsage() OVERRIDE { } | 45 virtual void SetSupportNetworkUsage() OVERRIDE { } |
| 48 | 46 |
| 49 virtual void Refresh() OVERRIDE; | 47 virtual void Refresh() OVERRIDE; |
| 50 | 48 |
| 51 virtual void NotifyResourceTypeStats( | 49 virtual void NotifyResourceTypeStats( |
| 52 const blink::WebCache::ResourceTypeStats& stats) OVERRIDE; | 50 const blink::WebCache::ResourceTypeStats& stats) OVERRIDE; |
| 53 | 51 |
| 54 virtual void NotifyFPS(float fps) OVERRIDE; | |
| 55 | |
| 56 virtual void NotifyV8HeapStats(size_t v8_memory_allocated, | 52 virtual void NotifyV8HeapStats(size_t v8_memory_allocated, |
| 57 size_t v8_memory_used) OVERRIDE; | 53 size_t v8_memory_used) OVERRIDE; |
| 58 | 54 |
| 59 content::RenderViewHost* render_view_host() const { | 55 content::RenderViewHost* render_view_host() const { |
| 60 return render_view_host_; | 56 return render_view_host_; |
| 61 } | 57 } |
| 62 | 58 |
| 63 private: | 59 private: |
| 64 base::ProcessHandle process_; | 60 base::ProcessHandle process_; |
| 65 int pid_; | 61 int pid_; |
| 66 int unique_process_id_; | 62 int unique_process_id_; |
| 67 | 63 |
| 68 // RenderViewHost we use to fetch stats. | 64 // RenderViewHost we use to fetch stats. |
| 69 content::RenderViewHost* render_view_host_; | 65 content::RenderViewHost* render_view_host_; |
| 70 // The stats_ field holds information about resource usage in the renderer | 66 // The stats_ field holds information about resource usage in the renderer |
| 71 // process and so it is updated asynchronously by the Refresh() call. | 67 // process and so it is updated asynchronously by the Refresh() call. |
| 72 blink::WebCache::ResourceTypeStats stats_; | 68 blink::WebCache::ResourceTypeStats stats_; |
| 73 // This flag is true if we are waiting for the renderer to report its stats. | 69 // This flag is true if we are waiting for the renderer to report its stats. |
| 74 bool pending_stats_update_; | 70 bool pending_stats_update_; |
| 75 | 71 |
| 76 // The fps_ field holds the renderer frames per second. | |
| 77 float fps_; | |
| 78 // This flag is true if we are waiting for the renderer to report its FPS. | |
| 79 bool pending_fps_update_; | |
| 80 | |
| 81 // We do a similar dance to gather the V8 memory usage in a process. | 72 // We do a similar dance to gather the V8 memory usage in a process. |
| 82 size_t v8_memory_allocated_; | 73 size_t v8_memory_allocated_; |
| 83 size_t v8_memory_used_; | 74 size_t v8_memory_used_; |
| 84 bool pending_v8_memory_allocated_update_; | 75 bool pending_v8_memory_allocated_update_; |
| 85 | 76 |
| 86 DISALLOW_COPY_AND_ASSIGN(RendererResource); | 77 DISALLOW_COPY_AND_ASSIGN(RendererResource); |
| 87 }; | 78 }; |
| 88 | 79 |
| 89 } // namespace task_manager | 80 } // namespace task_manager |
| 90 | 81 |
| 91 #endif // CHROME_BROWSER_TASK_MANAGER_RENDERER_RESOURCE_H_ | 82 #endif // CHROME_BROWSER_TASK_MANAGER_RENDERER_RESOURCE_H_ |
| OLD | NEW |