| 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> |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 enum Type { | 62 enum Type { |
| 63 UNKNOWN = 0, | 63 UNKNOWN = 0, |
| 64 TASKMANAGER_RESOURCE_TYPE_LIST(TASKMANAGER_RESOURCE_TYPE_LIST_ENUM) | 64 TASKMANAGER_RESOURCE_TYPE_LIST(TASKMANAGER_RESOURCE_TYPE_LIST_ENUM) |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 virtual string16 GetTitle() const = 0; | 67 virtual string16 GetTitle() const = 0; |
| 68 virtual string16 GetProfileName() const = 0; | 68 virtual string16 GetProfileName() const = 0; |
| 69 virtual SkBitmap GetIcon() const = 0; | 69 virtual SkBitmap GetIcon() const = 0; |
| 70 virtual base::ProcessHandle GetProcess() const = 0; | 70 virtual base::ProcessHandle GetProcess() const = 0; |
| 71 virtual int GetUniqueChildProcessId() const = 0; |
| 71 virtual Type GetType() const = 0; | 72 virtual Type GetType() const = 0; |
| 72 virtual int GetRoutingID() const { return 0; } | 73 virtual int GetRoutingID() const { return 0; } |
| 73 | 74 |
| 74 virtual bool ReportsCacheStats() const { return false; } | 75 virtual bool ReportsCacheStats() const { return false; } |
| 75 virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const { | 76 virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const { |
| 76 return WebKit::WebCache::ResourceTypeStats(); | 77 return WebKit::WebCache::ResourceTypeStats(); |
| 77 } | 78 } |
| 78 | 79 |
| 79 virtual bool ReportsFPS() const { return false; } | 80 virtual bool ReportsFPS() const { return false; } |
| 80 virtual float GetFPS() const { return 0.0f; } | 81 virtual float GetFPS() const { return 0.0f; } |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 int GetResourceIndexForGroup(int group_index, int index_in_group) const; | 370 int GetResourceIndexForGroup(int group_index, int index_in_group) const; |
| 370 | 371 |
| 371 // Compares values in column |col_id| and rows |row1|, |row2|. | 372 // Compares values in column |col_id| and rows |row1|, |row2|. |
| 372 // Returns -1 if value in |row1| is less than value in |row2|, | 373 // Returns -1 if value in |row1| is less than value in |row2|, |
| 373 // 0 if they are equal, and 1 otherwise. | 374 // 0 if they are equal, and 1 otherwise. |
| 374 int CompareValues(int row1, int row2, int col_id) const; | 375 int CompareValues(int row1, int row2, int col_id) const; |
| 375 | 376 |
| 376 // Returns process handle for given resource. | 377 // Returns process handle for given resource. |
| 377 base::ProcessHandle GetResourceProcessHandle(int index) const; | 378 base::ProcessHandle GetResourceProcessHandle(int index) const; |
| 378 | 379 |
| 380 // Returns the unique child process ID generated by Chromium, not the OS |
| 381 // process id. This is used to identify processes internally and for |
| 382 // extensions. It is not meant to be displayed to the user. |
| 383 int GetUniqueChildProcessId(int index) const; |
| 384 |
| 379 // Returns the type of the given resource. | 385 // Returns the type of the given resource. |
| 380 TaskManager::Resource::Type GetResourceType(int index) const; | 386 TaskManager::Resource::Type GetResourceType(int index) const; |
| 381 | 387 |
| 382 // Returns TabContents of given resource or NULL if not applicable. | 388 // Returns TabContents of given resource or NULL if not applicable. |
| 383 TabContentsWrapper* GetResourceTabContents(int index) const; | 389 TabContentsWrapper* GetResourceTabContents(int index) const; |
| 384 | 390 |
| 385 // Returns Extension of given resource or NULL if not applicable. | 391 // Returns Extension of given resource or NULL if not applicable. |
| 386 const Extension* GetResourceExtension(int index) const; | 392 const Extension* GetResourceExtension(int index) const; |
| 387 | 393 |
| 388 void AddResource(TaskManager::Resource* resource); | 394 void AddResource(TaskManager::Resource* resource); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 // A salt lick for the goats. | 548 // A salt lick for the goats. |
| 543 uint64 goat_salt_; | 549 uint64 goat_salt_; |
| 544 | 550 |
| 545 // Resource identifier that is unique within single session. | 551 // Resource identifier that is unique within single session. |
| 546 int last_unique_id_; | 552 int last_unique_id_; |
| 547 | 553 |
| 548 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); | 554 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); |
| 549 }; | 555 }; |
| 550 | 556 |
| 551 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ | 557 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ |
| OLD | NEW |