| 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_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ |
| 6 #define CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ | 6 #define CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/singleton.h" | 15 #include "base/memory/singleton.h" |
| 16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
| 17 #include "base/process_util.h" | 17 #include "base/process_util.h" |
| 18 #include "base/string16.h" | 18 #include "base/string16.h" |
| 19 #include "base/timer.h" | 19 #include "base/timer.h" |
| 20 #include "chrome/browser/renderer_host/web_cache_manager.h" | 20 #include "chrome/browser/renderer_host/web_cache_manager.h" |
| 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" |
| 22 | 22 |
| 23 class TabContents; | |
| 24 class TaskManagerModel; | 23 class TaskManagerModel; |
| 25 | 24 |
| 26 namespace base { | 25 namespace base { |
| 27 class ProcessMetrics; | 26 class ProcessMetrics; |
| 28 } | 27 } |
| 29 | 28 |
| 29 namespace content { |
| 30 class WebContents; |
| 31 } |
| 32 |
| 30 namespace extensions { | 33 namespace extensions { |
| 31 class Extension; | 34 class Extension; |
| 32 } | 35 } |
| 33 | 36 |
| 34 namespace gfx { | 37 namespace gfx { |
| 35 class ImageSkia; | 38 class ImageSkia; |
| 36 } | 39 } |
| 37 | 40 |
| 38 namespace net { | 41 namespace net { |
| 39 class URLRequest; | 42 class URLRequest; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 virtual bool ReportsV8MemoryStats() const { return false; } | 99 virtual bool ReportsV8MemoryStats() const { return false; } |
| 97 virtual size_t GetV8MemoryAllocated() const { return 0; } | 100 virtual size_t GetV8MemoryAllocated() const { return 0; } |
| 98 virtual size_t GetV8MemoryUsed() const { return 0; } | 101 virtual size_t GetV8MemoryUsed() const { return 0; } |
| 99 | 102 |
| 100 // Returns true if this resource can be inspected using developer tools. | 103 // Returns true if this resource can be inspected using developer tools. |
| 101 virtual bool CanInspect() const { return false; } | 104 virtual bool CanInspect() const { return false; } |
| 102 | 105 |
| 103 // Invokes or reveals developer tools window for this resource. | 106 // Invokes or reveals developer tools window for this resource. |
| 104 virtual void Inspect() const {} | 107 virtual void Inspect() const {} |
| 105 | 108 |
| 106 // A helper function for ActivateFocusedTab. Returns NULL by default | 109 // A helper function for ActivateProcess when selected resource refers |
| 107 // because not all resources have an associated tab. | 110 // to a Tab or other window containing web contents. Returns NULL by |
| 108 virtual TabContents* GetTabContents() const { return NULL; } | 111 // default because not all resources have an associated web contents. |
| 112 virtual content::WebContents* GetWebContents() const { return NULL; } |
| 109 | 113 |
| 110 // Whether this resource does report the network usage accurately. | 114 // Whether this resource does report the network usage accurately. |
| 111 // This controls whether 0 or N/A is displayed when no bytes have been | 115 // This controls whether 0 or N/A is displayed when no bytes have been |
| 112 // reported as being read. This is because some plugins do not report the | 116 // reported as being read. This is because some plugins do not report the |
| 113 // bytes read and we don't want to display a misleading 0 value in that | 117 // bytes read and we don't want to display a misleading 0 value in that |
| 114 // case. | 118 // case. |
| 115 virtual bool SupportNetworkUsage() const = 0; | 119 virtual bool SupportNetworkUsage() const = 0; |
| 116 | 120 |
| 117 // Called when some bytes have been read and support_network_usage returns | 121 // Called when some bytes have been read and support_network_usage returns |
| 118 // false (meaning we do have network usage support). | 122 // false (meaning we do have network usage support). |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 base::ProcessHandle GetResourceProcessHandle(int index) const; | 398 base::ProcessHandle GetResourceProcessHandle(int index) const; |
| 395 | 399 |
| 396 // Returns the unique child process ID generated by Chromium, not the OS | 400 // Returns the unique child process ID generated by Chromium, not the OS |
| 397 // process id. This is used to identify processes internally and for | 401 // process id. This is used to identify processes internally and for |
| 398 // extensions. It is not meant to be displayed to the user. | 402 // extensions. It is not meant to be displayed to the user. |
| 399 int GetUniqueChildProcessId(int index) const; | 403 int GetUniqueChildProcessId(int index) const; |
| 400 | 404 |
| 401 // Returns the type of the given resource. | 405 // Returns the type of the given resource. |
| 402 TaskManager::Resource::Type GetResourceType(int index) const; | 406 TaskManager::Resource::Type GetResourceType(int index) const; |
| 403 | 407 |
| 404 // Returns TabContents of given resource or NULL if not applicable. | 408 // Returns WebContents of given resource or NULL if not applicable. |
| 405 TabContents* GetResourceTabContents(int index) const; | 409 content::WebContents* GetResourceWebContents(int index) const; |
| 406 | 410 |
| 407 // Returns Extension of given resource or NULL if not applicable. | 411 // Returns Extension of given resource or NULL if not applicable. |
| 408 const extensions::Extension* GetResourceExtension(int index) const; | 412 const extensions::Extension* GetResourceExtension(int index) const; |
| 409 | 413 |
| 410 void AddResource(TaskManager::Resource* resource); | 414 void AddResource(TaskManager::Resource* resource); |
| 411 void RemoveResource(TaskManager::Resource* resource); | 415 void RemoveResource(TaskManager::Resource* resource); |
| 412 | 416 |
| 413 void StartUpdating(); | 417 void StartUpdating(); |
| 414 void StopUpdating(); | 418 void StopUpdating(); |
| 415 | 419 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 // A salt lick for the goats. | 580 // A salt lick for the goats. |
| 577 uint64 goat_salt_; | 581 uint64 goat_salt_; |
| 578 | 582 |
| 579 // Resource identifier that is unique within single session. | 583 // Resource identifier that is unique within single session. |
| 580 int last_unique_id_; | 584 int last_unique_id_; |
| 581 | 585 |
| 582 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); | 586 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); |
| 583 }; | 587 }; |
| 584 | 588 |
| 585 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ | 589 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ |
| OLD | NEW |