| 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_TASK_MANAGER_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGEMENT_TASK_MANAGER_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_TASK_MANAGEMENT_TASK_MANAGER_OBSERVER_H_ | 6 #define CHROME_BROWSER_TASK_MANAGEMENT_TASK_MANAGER_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 virtual void OnTaskToBeRemoved(TaskId id) = 0; | 79 virtual void OnTaskToBeRemoved(TaskId id) = 0; |
| 80 | 80 |
| 81 // Notifies the observer that the task manager has just finished a refresh | 81 // Notifies the observer that the task manager has just finished a refresh |
| 82 // cycle to calculate the resources usage of all tasks whose IDs are given in | 82 // cycle to calculate the resources usage of all tasks whose IDs are given in |
| 83 // |task_ids|. |task_ids| will be sorted such that the task representing the | 83 // |task_ids|. |task_ids| will be sorted such that the task representing the |
| 84 // browser process is at the top of the list and the rest of the IDs will be | 84 // browser process is at the top of the list and the rest of the IDs will be |
| 85 // sorted by the process IDs on which the tasks are running, then by the task | 85 // sorted by the process IDs on which the tasks are running, then by the task |
| 86 // IDs themselves. | 86 // IDs themselves. |
| 87 virtual void OnTasksRefreshed(const TaskIdList& task_ids) = 0; | 87 virtual void OnTasksRefreshed(const TaskIdList& task_ids) = 0; |
| 88 | 88 |
| 89 // Notifies the observer that the task with |id| is running on a renderer that |
| 90 // has become unresponsive. |
| 91 virtual void OnTaskUnresponsive(TaskId id) {} |
| 92 |
| 89 const base::TimeDelta& desired_refresh_time() const { | 93 const base::TimeDelta& desired_refresh_time() const { |
| 90 return desired_refresh_time_; | 94 return desired_refresh_time_; |
| 91 } | 95 } |
| 92 | 96 |
| 93 int64_t desired_resources_flags() const { return desired_resources_flags_; } | 97 int64_t desired_resources_flags() const { return desired_resources_flags_; } |
| 94 | 98 |
| 95 protected: | 99 protected: |
| 96 TaskManagerInterface* observed_task_manager() const { | 100 TaskManagerInterface* observed_task_manager() const { |
| 97 return observed_task_manager_; | 101 return observed_task_manager_; |
| 98 } | 102 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 115 // calculated on each refresh. | 119 // calculated on each refresh. |
| 116 int64_t desired_resources_flags_; | 120 int64_t desired_resources_flags_; |
| 117 | 121 |
| 118 DISALLOW_COPY_AND_ASSIGN(TaskManagerObserver); | 122 DISALLOW_COPY_AND_ASSIGN(TaskManagerObserver); |
| 119 }; | 123 }; |
| 120 | 124 |
| 121 } // namespace task_management | 125 } // namespace task_management |
| 122 | 126 |
| 123 | 127 |
| 124 #endif // CHROME_BROWSER_TASK_MANAGEMENT_TASK_MANAGER_OBSERVER_H_ | 128 #endif // CHROME_BROWSER_TASK_MANAGEMENT_TASK_MANAGER_OBSERVER_H_ |
| OLD | NEW |