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 15 matching lines...) Expand all Loading... |
26 | 26 |
27 class TaskManagerTabContentsResource : public TaskManager::Resource { | 27 class TaskManagerTabContentsResource : public TaskManager::Resource { |
28 public: | 28 public: |
29 explicit TaskManagerTabContentsResource(TabContents* tab_contents); | 29 explicit TaskManagerTabContentsResource(TabContents* tab_contents); |
30 ~TaskManagerTabContentsResource(); | 30 ~TaskManagerTabContentsResource(); |
31 | 31 |
32 // TaskManagerResource methods: | 32 // TaskManagerResource methods: |
33 std::wstring GetTitle() const; | 33 std::wstring GetTitle() const; |
34 SkBitmap GetIcon() const; | 34 SkBitmap GetIcon() const; |
35 base::ProcessHandle GetProcess() const; | 35 base::ProcessHandle GetProcess() const; |
| 36 Type GetType() const { return RENDERER; } |
36 TabContents* GetTabContents() const; | 37 TabContents* GetTabContents() const; |
37 | 38 |
38 virtual bool ReportsCacheStats() const { return true; } | 39 virtual bool ReportsCacheStats() const { return true; } |
39 virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const; | 40 virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const; |
40 | 41 |
41 virtual bool ReportsV8MemoryStats() const { return true; } | 42 virtual bool ReportsV8MemoryStats() const { return true; } |
42 virtual size_t GetV8MemoryAllocated() const; | 43 virtual size_t GetV8MemoryAllocated() const; |
43 virtual size_t GetV8MemoryUsed() const; | 44 virtual size_t GetV8MemoryUsed() const; |
44 | 45 |
45 // TabContents always provide the network usage. | 46 // TabContents always provide the network usage. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 116 |
116 class TaskManagerChildProcessResource : public TaskManager::Resource { | 117 class TaskManagerChildProcessResource : public TaskManager::Resource { |
117 public: | 118 public: |
118 explicit TaskManagerChildProcessResource(ChildProcessInfo child_proc); | 119 explicit TaskManagerChildProcessResource(ChildProcessInfo child_proc); |
119 ~TaskManagerChildProcessResource(); | 120 ~TaskManagerChildProcessResource(); |
120 | 121 |
121 // TaskManagerResource methods: | 122 // TaskManagerResource methods: |
122 std::wstring GetTitle() const; | 123 std::wstring GetTitle() const; |
123 SkBitmap GetIcon() const; | 124 SkBitmap GetIcon() const; |
124 base::ProcessHandle GetProcess() const; | 125 base::ProcessHandle GetProcess() const; |
| 126 Type GetType() const; |
125 | 127 |
126 bool SupportNetworkUsage() const { | 128 bool SupportNetworkUsage() const { |
127 return network_usage_support_; | 129 return network_usage_support_; |
128 } | 130 } |
129 | 131 |
130 void SetSupportNetworkUsage() { | 132 void SetSupportNetworkUsage() { |
131 network_usage_support_ = true; | 133 network_usage_support_ = true; |
132 } | 134 } |
133 | 135 |
134 // Returns the pid of the child process. | 136 // Returns the pid of the child process. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 206 |
205 class TaskManagerExtensionProcessResource : public TaskManager::Resource { | 207 class TaskManagerExtensionProcessResource : public TaskManager::Resource { |
206 public: | 208 public: |
207 explicit TaskManagerExtensionProcessResource(ExtensionHost* extension_host); | 209 explicit TaskManagerExtensionProcessResource(ExtensionHost* extension_host); |
208 ~TaskManagerExtensionProcessResource(); | 210 ~TaskManagerExtensionProcessResource(); |
209 | 211 |
210 // TaskManagerResource methods: | 212 // TaskManagerResource methods: |
211 std::wstring GetTitle() const; | 213 std::wstring GetTitle() const; |
212 SkBitmap GetIcon() const; | 214 SkBitmap GetIcon() const; |
213 base::ProcessHandle GetProcess() const; | 215 base::ProcessHandle GetProcess() const; |
| 216 Type GetType() const { return EXTENSION; } |
214 bool SupportNetworkUsage() const { return true; } | 217 bool SupportNetworkUsage() const { return true; } |
215 void SetSupportNetworkUsage() { NOTREACHED(); } | 218 void SetSupportNetworkUsage() { NOTREACHED(); } |
216 const Extension* GetExtension() const; | 219 const Extension* GetExtension() const; |
217 | 220 |
218 // Returns the pid of the extension process. | 221 // Returns the pid of the extension process. |
219 int process_id() const { return pid_; } | 222 int process_id() const { return pid_; } |
220 | 223 |
221 private: | 224 private: |
222 // The icon painted for the extension process. | 225 // The icon painted for the extension process. |
223 static SkBitmap* default_icon_; | 226 static SkBitmap* default_icon_; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 | 278 |
276 class TaskManagerNotificationResource : public TaskManager::Resource { | 279 class TaskManagerNotificationResource : public TaskManager::Resource { |
277 public: | 280 public: |
278 explicit TaskManagerNotificationResource(BalloonHost* balloon_host); | 281 explicit TaskManagerNotificationResource(BalloonHost* balloon_host); |
279 ~TaskManagerNotificationResource(); | 282 ~TaskManagerNotificationResource(); |
280 | 283 |
281 // TaskManager::Resource interface | 284 // TaskManager::Resource interface |
282 std::wstring GetTitle() const { return title_; } | 285 std::wstring GetTitle() const { return title_; } |
283 SkBitmap GetIcon() const; | 286 SkBitmap GetIcon() const; |
284 base::ProcessHandle GetProcess() const; | 287 base::ProcessHandle GetProcess() const; |
| 288 Type GetType() const { return NOTIFICATION; } |
285 virtual bool SupportNetworkUsage() const { return false; } | 289 virtual bool SupportNetworkUsage() const { return false; } |
286 virtual void SetSupportNetworkUsage() { } | 290 virtual void SetSupportNetworkUsage() { } |
287 | 291 |
288 private: | 292 private: |
289 // The icon painted for notifications. . | 293 // The icon painted for notifications. . |
290 static SkBitmap* default_icon_; | 294 static SkBitmap* default_icon_; |
291 | 295 |
292 // Non-owned pointer to the balloon host. | 296 // Non-owned pointer to the balloon host. |
293 BalloonHost* balloon_host_; | 297 BalloonHost* balloon_host_; |
294 | 298 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 | 343 |
340 class TaskManagerBrowserProcessResource : public TaskManager::Resource { | 344 class TaskManagerBrowserProcessResource : public TaskManager::Resource { |
341 public: | 345 public: |
342 TaskManagerBrowserProcessResource(); | 346 TaskManagerBrowserProcessResource(); |
343 ~TaskManagerBrowserProcessResource(); | 347 ~TaskManagerBrowserProcessResource(); |
344 | 348 |
345 // TaskManagerResource methods: | 349 // TaskManagerResource methods: |
346 std::wstring GetTitle() const; | 350 std::wstring GetTitle() const; |
347 SkBitmap GetIcon() const; | 351 SkBitmap GetIcon() const; |
348 base::ProcessHandle GetProcess() const; | 352 base::ProcessHandle GetProcess() const; |
| 353 Type GetType() const { return BROWSER; } |
349 | 354 |
350 bool SupportNetworkUsage() const { return true; } | 355 bool SupportNetworkUsage() const { return true; } |
351 void SetSupportNetworkUsage() { NOTREACHED(); } | 356 void SetSupportNetworkUsage() { NOTREACHED(); } |
352 | 357 |
353 bool ReportsSqliteMemoryUsed() const { return true; } | 358 bool ReportsSqliteMemoryUsed() const { return true; } |
354 size_t SqliteMemoryUsedBytes() const; | 359 size_t SqliteMemoryUsedBytes() const; |
355 | 360 |
356 // Returns the pid of the browser process. | 361 // Returns the pid of the browser process. |
357 int process_id() const { return pid_; } | 362 int process_id() const { return pid_; } |
358 | 363 |
(...skipping 28 matching lines...) Expand all Loading... |
387 | 392 |
388 void AddToTaskManager(ChildProcessInfo child_process_info); | 393 void AddToTaskManager(ChildProcessInfo child_process_info); |
389 | 394 |
390 TaskManager* task_manager_; | 395 TaskManager* task_manager_; |
391 TaskManagerBrowserProcessResource resource_; | 396 TaskManagerBrowserProcessResource resource_; |
392 | 397 |
393 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); | 398 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); |
394 }; | 399 }; |
395 | 400 |
396 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ | 401 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ |
OLD | NEW |