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_management/sampling/task_manager_impl.h" | 5 #include "chrome/browser/task_management/sampling/task_manager_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 } | 92 } |
93 | 93 |
94 int64_t TaskManagerImpl::GetPrivateMemoryUsage(TaskId task_id) const { | 94 int64_t TaskManagerImpl::GetPrivateMemoryUsage(TaskId task_id) const { |
95 return GetTaskGroupByTaskId(task_id)->private_bytes(); | 95 return GetTaskGroupByTaskId(task_id)->private_bytes(); |
96 } | 96 } |
97 | 97 |
98 int64_t TaskManagerImpl::GetSharedMemoryUsage(TaskId task_id) const { | 98 int64_t TaskManagerImpl::GetSharedMemoryUsage(TaskId task_id) const { |
99 return GetTaskGroupByTaskId(task_id)->shared_bytes(); | 99 return GetTaskGroupByTaskId(task_id)->shared_bytes(); |
100 } | 100 } |
101 | 101 |
| 102 int64_t TaskManagerImpl::GetSwappedMemoryUsage(TaskId task_id) const { |
| 103 #if defined(OS_CHROMEOS) |
| 104 return GetTaskGroupByTaskId(task_id)->swapped_bytes(); |
| 105 #else |
| 106 return -1; |
| 107 #endif |
| 108 } |
| 109 |
102 int64_t TaskManagerImpl::GetGpuMemoryUsage(TaskId task_id, | 110 int64_t TaskManagerImpl::GetGpuMemoryUsage(TaskId task_id, |
103 bool* has_duplicates) const { | 111 bool* has_duplicates) const { |
104 const TaskGroup* task_group = GetTaskGroupByTaskId(task_id); | 112 const TaskGroup* task_group = GetTaskGroupByTaskId(task_id); |
105 if (has_duplicates) | 113 if (has_duplicates) |
106 *has_duplicates = task_group->gpu_memory_has_duplicates(); | 114 *has_duplicates = task_group->gpu_memory_has_duplicates(); |
107 return task_group->gpu_memory(); | 115 return task_group->gpu_memory(); |
108 } | 116 } |
109 | 117 |
110 int TaskManagerImpl::GetIdleWakeupsPerSecond(TaskId task_id) const { | 118 int TaskManagerImpl::GetIdleWakeupsPerSecond(TaskId task_id) const { |
111 return GetTaskGroupByTaskId(task_id)->idle_wakeups_per_second(); | 119 return GetTaskGroupByTaskId(task_id)->idle_wakeups_per_second(); |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 groups_itr.second->AreBackgroundCalculationsDone(); | 448 groups_itr.second->AreBackgroundCalculationsDone(); |
441 } | 449 } |
442 if (are_all_processes_data_ready) { | 450 if (are_all_processes_data_ready) { |
443 NotifyObserversOnRefreshWithBackgroundCalculations(GetTaskIdsList()); | 451 NotifyObserversOnRefreshWithBackgroundCalculations(GetTaskIdsList()); |
444 for (auto& groups_itr : task_groups_by_proc_id_) | 452 for (auto& groups_itr : task_groups_by_proc_id_) |
445 groups_itr.second->ClearCurrentBackgroundCalculationsFlags(); | 453 groups_itr.second->ClearCurrentBackgroundCalculationsFlags(); |
446 } | 454 } |
447 } | 455 } |
448 | 456 |
449 } // namespace task_management | 457 } // namespace task_management |
OLD | NEW |