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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/singleton.h" | 16 #include "base/memory/singleton.h" |
17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
18 #include "base/process_util.h" | 18 #include "base/process_util.h" |
19 #include "base/string16.h" | 19 #include "base/string16.h" |
20 #include "base/timer.h" | 20 #include "base/timer.h" |
21 #include "chrome/browser/renderer_host/web_cache_manager.h" | 21 #include "chrome/browser/renderer_host/web_cache_manager.h" |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" |
23 | 23 |
24 class Extension; | |
25 class SkBitmap; | 24 class SkBitmap; |
26 class TabContentsWrapper; | 25 class TabContentsWrapper; |
27 class TaskManagerModel; | 26 class TaskManagerModel; |
28 | 27 |
29 namespace base { | 28 namespace base { |
30 class ProcessMetrics; | 29 class ProcessMetrics; |
31 } | 30 } |
| 31 |
| 32 namespace extensions { |
| 33 class Extension; |
| 34 } |
| 35 |
32 namespace net { | 36 namespace net { |
33 class URLRequest; | 37 class URLRequest; |
34 } | 38 } |
35 | 39 |
36 #define TASKMANAGER_RESOURCE_TYPE_LIST(def) \ | 40 #define TASKMANAGER_RESOURCE_TYPE_LIST(def) \ |
37 def(BROWSER) /* The main browser process. */ \ | 41 def(BROWSER) /* The main browser process. */ \ |
38 def(RENDERER) /* A normal WebContents renderer process. */ \ | 42 def(RENDERER) /* A normal WebContents renderer process. */ \ |
39 def(EXTENSION) /* An extension or app process. */ \ | 43 def(EXTENSION) /* An extension or app process. */ \ |
40 def(NOTIFICATION) /* A notification process. */ \ | 44 def(NOTIFICATION) /* A notification process. */ \ |
41 def(PLUGIN) /* A plugin process. */ \ | 45 def(PLUGIN) /* A plugin process. */ \ |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 82 } |
79 | 83 |
80 virtual bool ReportsFPS() const { return false; } | 84 virtual bool ReportsFPS() const { return false; } |
81 virtual float GetFPS() const { return 0.0f; } | 85 virtual float GetFPS() const { return 0.0f; } |
82 | 86 |
83 virtual bool ReportsSqliteMemoryUsed() const { return false; } | 87 virtual bool ReportsSqliteMemoryUsed() const { return false; } |
84 virtual size_t SqliteMemoryUsedBytes() const { return 0; } | 88 virtual size_t SqliteMemoryUsedBytes() const { return 0; } |
85 | 89 |
86 // Return extension associated with the resource, or NULL | 90 // Return extension associated with the resource, or NULL |
87 // if not applicable. | 91 // if not applicable. |
88 virtual const Extension* GetExtension() const { return NULL; } | 92 virtual const extensions::Extension* GetExtension() const { return NULL; } |
89 | 93 |
90 virtual bool ReportsV8MemoryStats() const { return false; } | 94 virtual bool ReportsV8MemoryStats() const { return false; } |
91 virtual size_t GetV8MemoryAllocated() const { return 0; } | 95 virtual size_t GetV8MemoryAllocated() const { return 0; } |
92 virtual size_t GetV8MemoryUsed() const { return 0; } | 96 virtual size_t GetV8MemoryUsed() const { return 0; } |
93 | 97 |
94 // Returns true if this resource can be inspected using developer tools. | 98 // Returns true if this resource can be inspected using developer tools. |
95 virtual bool CanInspect() const { return false; } | 99 virtual bool CanInspect() const { return false; } |
96 | 100 |
97 // Invokes or reveals developer tools window for this resource. | 101 // Invokes or reveals developer tools window for this resource. |
98 virtual void Inspect() const {} | 102 virtual void Inspect() const {} |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 // extensions. It is not meant to be displayed to the user. | 396 // extensions. It is not meant to be displayed to the user. |
393 int GetUniqueChildProcessId(int index) const; | 397 int GetUniqueChildProcessId(int index) const; |
394 | 398 |
395 // Returns the type of the given resource. | 399 // Returns the type of the given resource. |
396 TaskManager::Resource::Type GetResourceType(int index) const; | 400 TaskManager::Resource::Type GetResourceType(int index) const; |
397 | 401 |
398 // Returns TabContentsWrapper of given resource or NULL if not applicable. | 402 // Returns TabContentsWrapper of given resource or NULL if not applicable. |
399 TabContentsWrapper* GetResourceTabContents(int index) const; | 403 TabContentsWrapper* GetResourceTabContents(int index) const; |
400 | 404 |
401 // Returns Extension of given resource or NULL if not applicable. | 405 // Returns Extension of given resource or NULL if not applicable. |
402 const Extension* GetResourceExtension(int index) const; | 406 const extensions::Extension* GetResourceExtension(int index) const; |
403 | 407 |
404 void AddResource(TaskManager::Resource* resource); | 408 void AddResource(TaskManager::Resource* resource); |
405 void RemoveResource(TaskManager::Resource* resource); | 409 void RemoveResource(TaskManager::Resource* resource); |
406 | 410 |
407 void StartUpdating(); | 411 void StartUpdating(); |
408 void StopUpdating(); | 412 void StopUpdating(); |
409 | 413 |
410 // Listening involves calling StartUpdating on all resource providers. This | 414 // Listening involves calling StartUpdating on all resource providers. This |
411 // causes all of them to subscribe to notifications and enumerate current | 415 // causes all of them to subscribe to notifications and enumerate current |
412 // resources. It differs from StartUpdating that it doesn't start the | 416 // resources. It differs from StartUpdating that it doesn't start the |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 // A salt lick for the goats. | 574 // A salt lick for the goats. |
571 uint64 goat_salt_; | 575 uint64 goat_salt_; |
572 | 576 |
573 // Resource identifier that is unique within single session. | 577 // Resource identifier that is unique within single session. |
574 int last_unique_id_; | 578 int last_unique_id_; |
575 | 579 |
576 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); | 580 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); |
577 }; | 581 }; |
578 | 582 |
579 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ | 583 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ |
OLD | NEW |