| 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 #include "chrome/browser/task_manager/sampling/task_manager_impl.h" | 5 #include "chrome/browser/task_manager/sampling/task_manager_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 #include <unordered_set> | 10 #include <unordered_set> |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 } | 114 } |
| 115 | 115 |
| 116 int64_t TaskManagerImpl::GetGpuMemoryUsage(TaskId task_id, | 116 int64_t TaskManagerImpl::GetGpuMemoryUsage(TaskId task_id, |
| 117 bool* has_duplicates) const { | 117 bool* has_duplicates) const { |
| 118 const TaskGroup* task_group = GetTaskGroupByTaskId(task_id); | 118 const TaskGroup* task_group = GetTaskGroupByTaskId(task_id); |
| 119 if (has_duplicates) | 119 if (has_duplicates) |
| 120 *has_duplicates = task_group->gpu_memory_has_duplicates(); | 120 *has_duplicates = task_group->gpu_memory_has_duplicates(); |
| 121 return task_group->gpu_memory(); | 121 return task_group->gpu_memory(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 base::MemoryState TaskManagerImpl::GetMemoryState(TaskId task_id) const { |
| 125 return GetTaskGroupByTaskId(task_id)->memory_state(); |
| 126 } |
| 127 |
| 124 int TaskManagerImpl::GetIdleWakeupsPerSecond(TaskId task_id) const { | 128 int TaskManagerImpl::GetIdleWakeupsPerSecond(TaskId task_id) const { |
| 125 return GetTaskGroupByTaskId(task_id)->idle_wakeups_per_second(); | 129 return GetTaskGroupByTaskId(task_id)->idle_wakeups_per_second(); |
| 126 } | 130 } |
| 127 | 131 |
| 128 int TaskManagerImpl::GetNaClDebugStubPort(TaskId task_id) const { | 132 int TaskManagerImpl::GetNaClDebugStubPort(TaskId task_id) const { |
| 129 #if !defined(DISABLE_NACL) | 133 #if !defined(DISABLE_NACL) |
| 130 return GetTaskGroupByTaskId(task_id)->nacl_debug_stub_port(); | 134 return GetTaskGroupByTaskId(task_id)->nacl_debug_stub_port(); |
| 131 #else | 135 #else |
| 132 return -2; | 136 return -2; |
| 133 #endif // !defined(DISABLE_NACL) | 137 #endif // !defined(DISABLE_NACL) |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 groups_itr.second->AreBackgroundCalculationsDone(); | 544 groups_itr.second->AreBackgroundCalculationsDone(); |
| 541 } | 545 } |
| 542 if (are_all_processes_data_ready) { | 546 if (are_all_processes_data_ready) { |
| 543 NotifyObserversOnRefreshWithBackgroundCalculations(GetTaskIdsList()); | 547 NotifyObserversOnRefreshWithBackgroundCalculations(GetTaskIdsList()); |
| 544 for (const auto& groups_itr : task_groups_by_proc_id_) | 548 for (const auto& groups_itr : task_groups_by_proc_id_) |
| 545 groups_itr.second->ClearCurrentBackgroundCalculationsFlags(); | 549 groups_itr.second->ClearCurrentBackgroundCalculationsFlags(); |
| 546 } | 550 } |
| 547 } | 551 } |
| 548 | 552 |
| 549 } // namespace task_manager | 553 } // namespace task_manager |
| OLD | NEW |