| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TASK_MANAGER_RESOURCE_PROVIDERS_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ |
| 6 #define CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ | 6 #define CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/process_util.h" | 14 #include "base/process_util.h" |
| 15 #include "chrome/browser/task_manager/task_manager.h" | 15 #include "chrome/browser/task_manager/task_manager.h" |
| 16 #include "content/public/browser/child_process_data.h" | 16 #include "content/public/browser/child_process_data.h" |
| 17 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
| 18 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
| 19 #include "content/public/common/process_type.h" | 19 #include "content/public/common/process_type.h" |
| 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" |
| 21 | 21 |
| 22 class BackgroundContents; | 22 class BackgroundContents; |
| 23 class BalloonHost; | 23 class BalloonHost; |
| 24 class Extension; | 24 class Extension; |
| 25 class ExtensionHost; | 25 class ExtensionHost; |
| 26 class TabContentsWrapper; |
| 27 |
| 28 namespace content { |
| 26 class RenderViewHost; | 29 class RenderViewHost; |
| 27 class TabContentsWrapper; | 30 } |
| 28 | 31 |
| 29 // These file contains the resource providers used in the task manager. | 32 // These file contains the resource providers used in the task manager. |
| 30 | 33 |
| 31 // Base class for various types of render process resources that provides common | 34 // Base class for various types of render process resources that provides common |
| 32 // functionality like stats tracking. | 35 // functionality like stats tracking. |
| 33 class TaskManagerRendererResource : public TaskManager::Resource { | 36 class TaskManagerRendererResource : public TaskManager::Resource { |
| 34 public: | 37 public: |
| 35 TaskManagerRendererResource(base::ProcessHandle process, | 38 TaskManagerRendererResource(base::ProcessHandle process, |
| 36 RenderViewHost* render_view_host); | 39 content::RenderViewHost* render_view_host); |
| 37 virtual ~TaskManagerRendererResource(); | 40 virtual ~TaskManagerRendererResource(); |
| 38 | 41 |
| 39 // TaskManager::Resource methods: | 42 // TaskManager::Resource methods: |
| 40 virtual base::ProcessHandle GetProcess() const OVERRIDE; | 43 virtual base::ProcessHandle GetProcess() const OVERRIDE; |
| 41 virtual Type GetType() const OVERRIDE; | 44 virtual Type GetType() const OVERRIDE; |
| 42 virtual int GetRoutingID() const OVERRIDE; | 45 virtual int GetRoutingID() const OVERRIDE; |
| 43 | 46 |
| 44 virtual bool ReportsCacheStats() const OVERRIDE; | 47 virtual bool ReportsCacheStats() const OVERRIDE; |
| 45 virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const | 48 virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const |
| 46 OVERRIDE; | 49 OVERRIDE; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 66 virtual void NotifyFPS(float fps) OVERRIDE; | 69 virtual void NotifyFPS(float fps) OVERRIDE; |
| 67 | 70 |
| 68 virtual void NotifyV8HeapStats(size_t v8_memory_allocated, | 71 virtual void NotifyV8HeapStats(size_t v8_memory_allocated, |
| 69 size_t v8_memory_used) OVERRIDE; | 72 size_t v8_memory_used) OVERRIDE; |
| 70 | 73 |
| 71 private: | 74 private: |
| 72 base::ProcessHandle process_; | 75 base::ProcessHandle process_; |
| 73 int pid_; | 76 int pid_; |
| 74 | 77 |
| 75 // RenderViewHost we use to fetch stats. | 78 // RenderViewHost we use to fetch stats. |
| 76 RenderViewHost* render_view_host_; | 79 content::RenderViewHost* render_view_host_; |
| 77 // The stats_ field holds information about resource usage in the renderer | 80 // The stats_ field holds information about resource usage in the renderer |
| 78 // process and so it is updated asynchronously by the Refresh() call. | 81 // process and so it is updated asynchronously by the Refresh() call. |
| 79 WebKit::WebCache::ResourceTypeStats stats_; | 82 WebKit::WebCache::ResourceTypeStats stats_; |
| 80 // This flag is true if we are waiting for the renderer to report its stats. | 83 // This flag is true if we are waiting for the renderer to report its stats. |
| 81 bool pending_stats_update_; | 84 bool pending_stats_update_; |
| 82 | 85 |
| 83 // The fps_ field holds the renderer frames per second. | 86 // The fps_ field holds the renderer frames per second. |
| 84 float fps_; | 87 float fps_; |
| 85 // This flag is true if we are waiting for the renderer to report its FPS. | 88 // This flag is true if we are waiting for the renderer to report its FPS. |
| 86 bool pending_fps_update_; | 89 bool pending_fps_update_; |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 private: | 535 private: |
| 533 virtual ~TaskManagerBrowserProcessResourceProvider(); | 536 virtual ~TaskManagerBrowserProcessResourceProvider(); |
| 534 | 537 |
| 535 TaskManager* task_manager_; | 538 TaskManager* task_manager_; |
| 536 TaskManagerBrowserProcessResource resource_; | 539 TaskManagerBrowserProcessResource resource_; |
| 537 | 540 |
| 538 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); | 541 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); |
| 539 }; | 542 }; |
| 540 | 543 |
| 541 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ | 544 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ |
| OLD | NEW |