OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_RESOURCE_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGER_RESOURCE_PROVIDER_H_ |
6 #define CHROME_BROWSER_TASK_MANAGER_RESOURCE_PROVIDER_H_ | 6 #define CHROME_BROWSER_TASK_MANAGER_RESOURCE_PROVIDER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/process/process_handle.h" | 10 #include "base/process/process_handle.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // Called when some bytes have been read and support_network_usage returns | 89 // Called when some bytes have been read and support_network_usage returns |
90 // false (meaning we do have network usage support). | 90 // false (meaning we do have network usage support). |
91 virtual void SetSupportNetworkUsage() = 0; | 91 virtual void SetSupportNetworkUsage() = 0; |
92 | 92 |
93 // The TaskManagerModel periodically refreshes its data and call this | 93 // The TaskManagerModel periodically refreshes its data and call this |
94 // on all live resources. | 94 // on all live resources. |
95 virtual void Refresh() {} | 95 virtual void Refresh() {} |
96 | 96 |
97 virtual void NotifyResourceTypeStats( | 97 virtual void NotifyResourceTypeStats( |
98 const blink::WebCache::ResourceTypeStats& stats) {} | 98 const blink::WebCache::ResourceTypeStats& stats) {} |
99 virtual void NotifyV8HeapStats(size_t v8_memory_allocated, | |
100 size_t v8_memory_used) {} | |
101 | 99 |
102 static const char* GetResourceTypeAsString(const Type type) { | 100 static const char* GetResourceTypeAsString(const Type type) { |
103 switch (type) { | 101 switch (type) { |
104 TASKMANAGER_RESOURCE_TYPE_LIST(TASKMANAGER_RESOURCE_TYPE_LIST_AS_STRING) | 102 TASKMANAGER_RESOURCE_TYPE_LIST(TASKMANAGER_RESOURCE_TYPE_LIST_AS_STRING) |
105 default: return "UNKNOWN"; | 103 default: return "UNKNOWN"; |
106 } | 104 } |
107 } | 105 } |
108 | 106 |
109 protected: | 107 protected: |
110 Resource() {} | 108 Resource() {} |
(...skipping 30 matching lines...) Expand all Loading... |
141 | 139 |
142 protected: | 140 protected: |
143 friend class base::RefCountedThreadSafe<ResourceProvider>; | 141 friend class base::RefCountedThreadSafe<ResourceProvider>; |
144 | 142 |
145 virtual ~ResourceProvider() {} | 143 virtual ~ResourceProvider() {} |
146 }; | 144 }; |
147 | 145 |
148 } // namespace task_manager | 146 } // namespace task_manager |
149 | 147 |
150 #endif // CHROME_BROWSER_TASK_MANAGER_RESOURCE_PROVIDER_H_ | 148 #endif // CHROME_BROWSER_TASK_MANAGER_RESOURCE_PROVIDER_H_ |
OLD | NEW |