OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 10 #include <string> |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // The provider remains the owner of the resource objects and is responsible | 116 // The provider remains the owner of the resource objects and is responsible |
117 // for deleting them (when StopUpdating() is called). | 117 // for deleting them (when StopUpdating() is called). |
118 // After StopUpdating() is called the provider should also stop reporting | 118 // After StopUpdating() is called the provider should also stop reporting |
119 // notifications to the task manager. | 119 // notifications to the task manager. |
120 // Note: ResourceProviders have to be ref counted as they are used in | 120 // Note: ResourceProviders have to be ref counted as they are used in |
121 // MessageLoop::InvokeLater(). | 121 // MessageLoop::InvokeLater(). |
122 class ResourceProvider : public base::RefCountedThreadSafe<ResourceProvider> { | 122 class ResourceProvider : public base::RefCountedThreadSafe<ResourceProvider> { |
123 public: | 123 public: |
124 // Should return the resource associated to the specified ids, or NULL if | 124 // Should return the resource associated to the specified ids, or NULL if |
125 // the resource does not belong to this provider. | 125 // the resource does not belong to this provider. |
126 virtual TaskManager::Resource* GetResource(int process_id, | 126 virtual TaskManager::Resource* GetResource(int origin_child_id, |
127 int render_process_host_id, | 127 int render_process_host_id, |
128 int routing_id) = 0; | 128 int routing_id) = 0; |
129 virtual void StartUpdating() = 0; | 129 virtual void StartUpdating() = 0; |
130 virtual void StopUpdating() = 0; | 130 virtual void StopUpdating() = 0; |
131 | 131 |
132 protected: | 132 protected: |
133 friend class base::RefCountedThreadSafe<ResourceProvider>; | 133 friend class base::RefCountedThreadSafe<ResourceProvider>; |
134 | 134 |
135 virtual ~ResourceProvider() {} | 135 virtual ~ResourceProvider() {} |
136 }; | 136 }; |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 // Whether we are currently in the process of updating. | 458 // Whether we are currently in the process of updating. |
459 UpdateState update_state_; | 459 UpdateState update_state_; |
460 | 460 |
461 // A salt lick for the goats. | 461 // A salt lick for the goats. |
462 int goat_salt_; | 462 int goat_salt_; |
463 | 463 |
464 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); | 464 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); |
465 }; | 465 }; |
466 | 466 |
467 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ | 467 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ |
OLD | NEW |