| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_MANAGEMENT_SAMPLING_TASK_MANAGER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGEMENT_SAMPLING_TASK_MANAGER_IMPL_H_ |
| 6 #define CHROME_BROWSER_TASK_MANAGEMENT_SAMPLING_TASK_MANAGER_IMPL_H_ | 6 #define CHROME_BROWSER_TASK_MANAGEMENT_SAMPLING_TASK_MANAGER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 TaskGroup* GetTaskGroupByTaskId(TaskId task_id) const; | 118 TaskGroup* GetTaskGroupByTaskId(TaskId task_id) const; |
| 119 Task* GetTaskByTaskId(TaskId task_id) const; | 119 Task* GetTaskByTaskId(TaskId task_id) const; |
| 120 | 120 |
| 121 // Called back by a TaskGroup when the resource calculations done on the | 121 // Called back by a TaskGroup when the resource calculations done on the |
| 122 // background thread has completed. | 122 // background thread has completed. |
| 123 void OnTaskGroupBackgroundCalculationsDone(); | 123 void OnTaskGroupBackgroundCalculationsDone(); |
| 124 | 124 |
| 125 const base::Closure on_background_data_ready_callback_; | 125 const base::Closure on_background_data_ready_callback_; |
| 126 | 126 |
| 127 // Map TaskGroups by the IDs of the processes they represent. | 127 // Map TaskGroups by the IDs of the processes they represent. |
| 128 // Keys and values are unique (no duplicates). | 128 std::map<base::ProcessId, std::unique_ptr<TaskGroup>> task_groups_by_proc_id_; |
| 129 std::map<base::ProcessId, TaskGroup*> task_groups_by_proc_id_; | |
| 130 | 129 |
| 131 // Map each task by its ID to the TaskGroup on which it resides. | 130 // Map each task by its ID to the TaskGroup on which it resides. |
| 132 // Keys are unique but values will have duplicates (i.e. multiple tasks | 131 // Keys are unique but values will have duplicates (i.e. multiple tasks |
| 133 // running on the same process represented by a single TaskGroup). | 132 // running on the same process represented by a single TaskGroup). |
| 134 std::map<TaskId, TaskGroup*> task_groups_by_task_id_; | 133 std::map<TaskId, TaskGroup*> task_groups_by_task_id_; |
| 135 | 134 |
| 136 // A cached sorted list of the task IDs. | 135 // A cached sorted list of the task IDs. |
| 137 mutable std::vector<TaskId> sorted_task_ids_; | 136 mutable std::vector<TaskId> sorted_task_ids_; |
| 138 | 137 |
| 139 // The manager of the IO thread helper used to handle network bytes | 138 // The manager of the IO thread helper used to handle network bytes |
| (...skipping 16 matching lines...) Expand all Loading... |
| 156 // This will be set to true while there are observers and the task manager is | 155 // This will be set to true while there are observers and the task manager is |
| 157 // running. | 156 // running. |
| 158 bool is_running_; | 157 bool is_running_; |
| 159 | 158 |
| 160 DISALLOW_COPY_AND_ASSIGN(TaskManagerImpl); | 159 DISALLOW_COPY_AND_ASSIGN(TaskManagerImpl); |
| 161 }; | 160 }; |
| 162 | 161 |
| 163 } // namespace task_management | 162 } // namespace task_management |
| 164 | 163 |
| 165 #endif // CHROME_BROWSER_TASK_MANAGEMENT_SAMPLING_TASK_MANAGER_IMPL_H_ | 164 #endif // CHROME_BROWSER_TASK_MANAGEMENT_SAMPLING_TASK_MANAGER_IMPL_H_ |
| OLD | NEW |