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 <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 146 |
147 void AddObserver(TaskManagerModelObserver* observer); | 147 void AddObserver(TaskManagerModelObserver* observer); |
148 void RemoveObserver(TaskManagerModelObserver* observer); | 148 void RemoveObserver(TaskManagerModelObserver* observer); |
149 | 149 |
150 // Returns number of registered resources. | 150 // Returns number of registered resources. |
151 int ResourceCount() const; | 151 int ResourceCount() const; |
152 // Returns number of registered groups. | 152 // Returns number of registered groups. |
153 int GroupCount() const; | 153 int GroupCount() const; |
154 | 154 |
155 // Methods to return raw resource information. | 155 // Methods to return raw resource information. |
| 156 int GetNaClDebugStubPort(int index) const; |
156 int64 GetNetworkUsage(int index) const; | 157 int64 GetNetworkUsage(int index) const; |
157 double GetCPUUsage(int index) const; | 158 double GetCPUUsage(int index) const; |
158 base::ProcessId GetProcessId(int index) const; | 159 base::ProcessId GetProcessId(int index) const; |
159 base::ProcessHandle GetProcess(int index) const; | 160 base::ProcessHandle GetProcess(int index) const; |
160 int GetResourceUniqueId(int index) const; | 161 int GetResourceUniqueId(int index) const; |
161 // Returns the index of resource that has the given |unique_id|. Returns -1 if | 162 // Returns the index of resource that has the given |unique_id|. Returns -1 if |
162 // no resouce has the |unique_id|. | 163 // no resouce has the |unique_id|. |
163 int GetResourceIndexByUniqueId(const int unique_id) const; | 164 int GetResourceIndexByUniqueId(const int unique_id) const; |
164 | 165 |
165 // Catchall method that calls off to the appropriate GetResourceXXX method | 166 // Catchall method that calls off to the appropriate GetResourceXXX method |
166 // based on |col_id|. |col_id| is an IDS_ value used to identify the column. | 167 // based on |col_id|. |col_id| is an IDS_ value used to identify the column. |
167 base::string16 GetResourceById(int index, int col_id) const; | 168 base::string16 GetResourceById(int index, int col_id) const; |
168 | 169 |
169 // Methods to return formatted resource information. | 170 // Methods to return formatted resource information. |
170 const base::string16& GetResourceTitle(int index) const; | 171 const base::string16& GetResourceTitle(int index) const; |
171 const base::string16& GetResourceProfileName(int index) const; | 172 const base::string16& GetResourceProfileName(int index) const; |
| 173 base::string16 GetResourceNaClDebugStubPort(int index) const; |
172 base::string16 GetResourceNetworkUsage(int index) const; | 174 base::string16 GetResourceNetworkUsage(int index) const; |
173 base::string16 GetResourceCPUUsage(int index) const; | 175 base::string16 GetResourceCPUUsage(int index) const; |
174 base::string16 GetResourcePrivateMemory(int index) const; | 176 base::string16 GetResourcePrivateMemory(int index) const; |
175 base::string16 GetResourceSharedMemory(int index) const; | 177 base::string16 GetResourceSharedMemory(int index) const; |
176 base::string16 GetResourcePhysicalMemory(int index) const; | 178 base::string16 GetResourcePhysicalMemory(int index) const; |
177 base::string16 GetResourceProcessId(int index) const; | 179 base::string16 GetResourceProcessId(int index) const; |
178 base::string16 GetResourceGDIHandles(int index) const; | 180 base::string16 GetResourceGDIHandles(int index) const; |
179 base::string16 GetResourceUSERHandles(int index) const; | 181 base::string16 GetResourceUSERHandles(int index) const; |
180 base::string16 GetResourceWebCoreImageCacheSize(int index) const; | 182 base::string16 GetResourceWebCoreImageCacheSize(int index) const; |
181 base::string16 GetResourceWebCoreScriptsCacheSize(int index) const; | 183 base::string16 GetResourceWebCoreScriptsCacheSize(int index) const; |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 #else | 353 #else |
352 static const int kUpdateTimeMs = 1000; | 354 static const int kUpdateTimeMs = 1000; |
353 #endif | 355 #endif |
354 | 356 |
355 // Values cached per resource. Values are validated on demand. The is_XXX | 357 // Values cached per resource. Values are validated on demand. The is_XXX |
356 // members indicate if a value is valid. | 358 // members indicate if a value is valid. |
357 struct PerResourceValues { | 359 struct PerResourceValues { |
358 PerResourceValues(); | 360 PerResourceValues(); |
359 ~PerResourceValues(); | 361 ~PerResourceValues(); |
360 | 362 |
| 363 bool is_nacl_debug_stub_port_valid; |
| 364 int nacl_debug_stub_port; |
| 365 |
361 bool is_title_valid; | 366 bool is_title_valid; |
362 base::string16 title; | 367 base::string16 title; |
363 | 368 |
364 bool is_profile_name_valid; | 369 bool is_profile_name_valid; |
365 base::string16 profile_name; | 370 base::string16 profile_name; |
366 | 371 |
367 // No is_network_usage since default (0) is fine. | 372 // No is_network_usage since default (0) is fine. |
368 int64 network_usage; | 373 int64 network_usage; |
369 | 374 |
370 bool is_process_id_valid; | 375 bool is_process_id_valid; |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 // All per-Resource values are stored here. | 569 // All per-Resource values are stored here. |
565 mutable PerResourceCache per_resource_cache_; | 570 mutable PerResourceCache per_resource_cache_; |
566 | 571 |
567 // All per-Process values are stored here. | 572 // All per-Process values are stored here. |
568 mutable PerProcessCache per_process_cache_; | 573 mutable PerProcessCache per_process_cache_; |
569 | 574 |
570 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); | 575 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); |
571 }; | 576 }; |
572 | 577 |
573 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ | 578 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ |
OLD | NEW |