OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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> |
(...skipping 18 matching lines...) Expand all Loading... |
29 // Base class for various types of render process resources that provides common | 29 // Base class for various types of render process resources that provides common |
30 // functionality like stats tracking. | 30 // functionality like stats tracking. |
31 class TaskManagerRendererResource : public TaskManager::Resource { | 31 class TaskManagerRendererResource : public TaskManager::Resource { |
32 public: | 32 public: |
33 TaskManagerRendererResource(base::ProcessHandle process, | 33 TaskManagerRendererResource(base::ProcessHandle process, |
34 RenderViewHost* render_view_host); | 34 RenderViewHost* render_view_host); |
35 virtual ~TaskManagerRendererResource(); | 35 virtual ~TaskManagerRendererResource(); |
36 | 36 |
37 // TaskManager::Resource methods: | 37 // TaskManager::Resource methods: |
38 base::ProcessHandle GetProcess() const; | 38 base::ProcessHandle GetProcess() const; |
39 Type GetType() const { return RENDERER; } | 39 virtual Type GetType() const { return RENDERER; } |
40 virtual bool ReportsCacheStats() const { return true; } | 40 virtual bool ReportsCacheStats() const { return true; } |
41 virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const; | 41 virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const; |
42 virtual bool ReportsV8MemoryStats() const { return true; } | 42 virtual bool ReportsV8MemoryStats() const { return true; } |
43 virtual size_t GetV8MemoryAllocated() const; | 43 virtual size_t GetV8MemoryAllocated() const; |
44 virtual size_t GetV8MemoryUsed() const; | 44 virtual size_t GetV8MemoryUsed() const; |
45 | 45 |
46 // RenderResources always provide the network usage. | 46 // RenderResources always provide the network usage. |
47 bool SupportNetworkUsage() const { return true; } | 47 bool SupportNetworkUsage() const { return true; } |
48 void SetSupportNetworkUsage() { } | 48 void SetSupportNetworkUsage() { } |
49 | 49 |
(...skipping 24 matching lines...) Expand all Loading... |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(TaskManagerRendererResource); | 75 DISALLOW_COPY_AND_ASSIGN(TaskManagerRendererResource); |
76 }; | 76 }; |
77 | 77 |
78 class TaskManagerTabContentsResource : public TaskManagerRendererResource { | 78 class TaskManagerTabContentsResource : public TaskManagerRendererResource { |
79 public: | 79 public: |
80 explicit TaskManagerTabContentsResource(TabContents* tab_contents); | 80 explicit TaskManagerTabContentsResource(TabContents* tab_contents); |
81 ~TaskManagerTabContentsResource(); | 81 ~TaskManagerTabContentsResource(); |
82 | 82 |
83 // TaskManager::Resource methods: | 83 // TaskManager::Resource methods: |
| 84 virtual Type GetType() const; |
84 virtual std::wstring GetTitle() const; | 85 virtual std::wstring GetTitle() const; |
85 virtual SkBitmap GetIcon() const; | 86 virtual SkBitmap GetIcon() const; |
86 virtual TabContents* GetTabContents() const; | 87 virtual TabContents* GetTabContents() const; |
| 88 virtual const Extension* GetExtension() const; |
87 | 89 |
88 private: | 90 private: |
89 TabContents* tab_contents_; | 91 TabContents* tab_contents_; |
90 | 92 |
91 DISALLOW_COPY_AND_ASSIGN(TaskManagerTabContentsResource); | 93 DISALLOW_COPY_AND_ASSIGN(TaskManagerTabContentsResource); |
92 }; | 94 }; |
93 | 95 |
94 class TaskManagerTabContentsResourceProvider | 96 class TaskManagerTabContentsResourceProvider |
95 : public TaskManager::ResourceProvider, | 97 : public TaskManager::ResourceProvider, |
96 public NotificationObserver { | 98 public NotificationObserver { |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 | 485 |
484 void AddToTaskManager(ChildProcessInfo child_process_info); | 486 void AddToTaskManager(ChildProcessInfo child_process_info); |
485 | 487 |
486 TaskManager* task_manager_; | 488 TaskManager* task_manager_; |
487 TaskManagerBrowserProcessResource resource_; | 489 TaskManagerBrowserProcessResource resource_; |
488 | 490 |
489 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); | 491 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); |
490 }; | 492 }; |
491 | 493 |
492 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ | 494 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ |
OLD | NEW |