| 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 virtual base::ProcessHandle GetProcess() const; | 38 virtual base::ProcessHandle GetProcess() const; |
| 39 virtual Type GetType() const { return RENDERER; } | 39 virtual Type GetType() const; |
| 40 virtual bool ReportsCacheStats() const { return true; } | 40 virtual bool ReportsCacheStats() const; |
| 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; |
| 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 virtual bool SupportNetworkUsage() const { return true; } | 47 virtual bool SupportNetworkUsage() const; |
| 48 virtual void SetSupportNetworkUsage() { } | 48 virtual void SetSupportNetworkUsage() { } |
| 49 | 49 |
| 50 virtual void Refresh(); | 50 virtual void Refresh(); |
| 51 | 51 |
| 52 virtual void NotifyResourceTypeStats( | 52 virtual void NotifyResourceTypeStats( |
| 53 const WebKit::WebCache::ResourceTypeStats& stats); | 53 const WebKit::WebCache::ResourceTypeStats& stats); |
| 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); | 56 size_t v8_memory_used); |
| 57 | 57 |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 | 291 |
| 292 class TaskManagerExtensionProcessResource : public TaskManager::Resource { | 292 class TaskManagerExtensionProcessResource : public TaskManager::Resource { |
| 293 public: | 293 public: |
| 294 explicit TaskManagerExtensionProcessResource(ExtensionHost* extension_host); | 294 explicit TaskManagerExtensionProcessResource(ExtensionHost* extension_host); |
| 295 virtual ~TaskManagerExtensionProcessResource(); | 295 virtual ~TaskManagerExtensionProcessResource(); |
| 296 | 296 |
| 297 // TaskManagerResource methods: | 297 // TaskManagerResource methods: |
| 298 virtual std::wstring GetTitle() const; | 298 virtual std::wstring GetTitle() const; |
| 299 virtual SkBitmap GetIcon() const; | 299 virtual SkBitmap GetIcon() const; |
| 300 virtual base::ProcessHandle GetProcess() const; | 300 virtual base::ProcessHandle GetProcess() const; |
| 301 virtual Type GetType() const { return EXTENSION; } | 301 virtual Type GetType() const; |
| 302 virtual bool SupportNetworkUsage() const { return true; } | 302 virtual bool SupportNetworkUsage() const; |
| 303 virtual void SetSupportNetworkUsage() { NOTREACHED(); } | 303 virtual void SetSupportNetworkUsage(); |
| 304 virtual const Extension* GetExtension() const; | 304 virtual const Extension* GetExtension() const; |
| 305 | 305 |
| 306 // Returns the pid of the extension process. | 306 // Returns the pid of the extension process. |
| 307 int process_id() const { return pid_; } | 307 int process_id() const { return pid_; } |
| 308 | 308 |
| 309 // Returns true if the associated extension has a background page. | 309 // Returns true if the associated extension has a background page. |
| 310 virtual bool IsBackground() const; | 310 virtual bool IsBackground() const; |
| 311 | 311 |
| 312 private: | 312 private: |
| 313 // The icon painted for the extension process. | 313 // The icon painted for the extension process. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 363 |
| 364 DISALLOW_COPY_AND_ASSIGN(TaskManagerExtensionProcessResourceProvider); | 364 DISALLOW_COPY_AND_ASSIGN(TaskManagerExtensionProcessResourceProvider); |
| 365 }; | 365 }; |
| 366 | 366 |
| 367 class TaskManagerNotificationResource : public TaskManager::Resource { | 367 class TaskManagerNotificationResource : public TaskManager::Resource { |
| 368 public: | 368 public: |
| 369 explicit TaskManagerNotificationResource(BalloonHost* balloon_host); | 369 explicit TaskManagerNotificationResource(BalloonHost* balloon_host); |
| 370 virtual ~TaskManagerNotificationResource(); | 370 virtual ~TaskManagerNotificationResource(); |
| 371 | 371 |
| 372 // TaskManager::Resource interface | 372 // TaskManager::Resource interface |
| 373 virtual std::wstring GetTitle() const { return title_; } | 373 virtual std::wstring GetTitle() const; |
| 374 virtual SkBitmap GetIcon() const; | 374 virtual SkBitmap GetIcon() const; |
| 375 virtual base::ProcessHandle GetProcess() const; | 375 virtual base::ProcessHandle GetProcess() const; |
| 376 virtual Type GetType() const { return NOTIFICATION; } | 376 virtual Type GetType() const; |
| 377 virtual bool SupportNetworkUsage() const { return false; } | 377 virtual bool SupportNetworkUsage() const; |
| 378 virtual void SetSupportNetworkUsage() { } | 378 virtual void SetSupportNetworkUsage() { } |
| 379 | 379 |
| 380 private: | 380 private: |
| 381 // The icon painted for notifications. . | 381 // The icon painted for notifications. . |
| 382 static SkBitmap* default_icon_; | 382 static SkBitmap* default_icon_; |
| 383 | 383 |
| 384 // Non-owned pointer to the balloon host. | 384 // Non-owned pointer to the balloon host. |
| 385 BalloonHost* balloon_host_; | 385 BalloonHost* balloon_host_; |
| 386 | 386 |
| 387 // Cached data about the balloon host. | 387 // Cached data about the balloon host. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 | 431 |
| 432 class TaskManagerBrowserProcessResource : public TaskManager::Resource { | 432 class TaskManagerBrowserProcessResource : public TaskManager::Resource { |
| 433 public: | 433 public: |
| 434 TaskManagerBrowserProcessResource(); | 434 TaskManagerBrowserProcessResource(); |
| 435 virtual ~TaskManagerBrowserProcessResource(); | 435 virtual ~TaskManagerBrowserProcessResource(); |
| 436 | 436 |
| 437 // TaskManagerResource methods: | 437 // TaskManagerResource methods: |
| 438 virtual std::wstring GetTitle() const; | 438 virtual std::wstring GetTitle() const; |
| 439 virtual SkBitmap GetIcon() const; | 439 virtual SkBitmap GetIcon() const; |
| 440 virtual base::ProcessHandle GetProcess() const; | 440 virtual base::ProcessHandle GetProcess() const; |
| 441 virtual Type GetType() const { return BROWSER; } | 441 virtual Type GetType() const; |
| 442 | 442 |
| 443 virtual bool SupportNetworkUsage() const { return true; } | 443 virtual bool SupportNetworkUsage() const; |
| 444 virtual void SetSupportNetworkUsage() { NOTREACHED(); } | 444 virtual void SetSupportNetworkUsage(); |
| 445 | 445 |
| 446 virtual bool ReportsSqliteMemoryUsed() const { return true; } | 446 virtual bool ReportsSqliteMemoryUsed() const; |
| 447 virtual size_t SqliteMemoryUsedBytes() const; | 447 virtual size_t SqliteMemoryUsedBytes() const; |
| 448 | 448 |
| 449 // Returns the pid of the browser process. | 449 // Returns the pid of the browser process. |
| 450 int process_id() const { return pid_; } | 450 int process_id() const { return pid_; } |
| 451 | 451 |
| 452 private: | 452 private: |
| 453 base::ProcessHandle process_; | 453 base::ProcessHandle process_; |
| 454 int pid_; | 454 int pid_; |
| 455 mutable std::wstring title_; | 455 mutable std::wstring title_; |
| 456 | 456 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 480 | 480 |
| 481 void AddToTaskManager(ChildProcessInfo child_process_info); | 481 void AddToTaskManager(ChildProcessInfo child_process_info); |
| 482 | 482 |
| 483 TaskManager* task_manager_; | 483 TaskManager* task_manager_; |
| 484 TaskManagerBrowserProcessResource resource_; | 484 TaskManagerBrowserProcessResource resource_; |
| 485 | 485 |
| 486 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); | 486 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); |
| 487 }; | 487 }; |
| 488 | 488 |
| 489 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ | 489 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ |
| OLD | NEW |