| 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_group.h" | 5 #include "chrome/browser/task_management/sampling/task_group.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 181 |
| 182 void TaskGroup::RefreshGpuMemory( | 182 void TaskGroup::RefreshGpuMemory( |
| 183 const content::GPUVideoMemoryUsageStats& gpu_memory_stats) { | 183 const content::GPUVideoMemoryUsageStats& gpu_memory_stats) { |
| 184 auto itr = gpu_memory_stats.process_map.find(process_id_); | 184 auto itr = gpu_memory_stats.process_map.find(process_id_); |
| 185 if (itr == gpu_memory_stats.process_map.end()) { | 185 if (itr == gpu_memory_stats.process_map.end()) { |
| 186 gpu_memory_ = -1; | 186 gpu_memory_ = -1; |
| 187 gpu_memory_has_duplicates_ = false; | 187 gpu_memory_has_duplicates_ = false; |
| 188 return; | 188 return; |
| 189 } | 189 } |
| 190 | 190 |
| 191 gpu_memory_ = static_cast<int64_t>(itr->second.video_memory); | 191 gpu_memory_ = itr->second.video_memory; |
| 192 gpu_memory_has_duplicates_ = itr->second.has_duplicates; | 192 gpu_memory_has_duplicates_ = itr->second.has_duplicates; |
| 193 } | 193 } |
| 194 | 194 |
| 195 void TaskGroup::RefreshWindowsHandles() { | 195 void TaskGroup::RefreshWindowsHandles() { |
| 196 #if defined(OS_WIN) | 196 #if defined(OS_WIN) |
| 197 GetWindowsHandles(process_handle_, | 197 GetWindowsHandles(process_handle_, |
| 198 &gdi_current_handles_, | 198 &gdi_current_handles_, |
| 199 &gdi_peak_handles_, | 199 &gdi_peak_handles_, |
| 200 &user_current_handles_, | 200 &user_current_handles_, |
| 201 &user_peak_handles_); | 201 &user_peak_handles_); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 } | 236 } |
| 237 #endif // defined(OS_LINUX) | 237 #endif // defined(OS_LINUX) |
| 238 | 238 |
| 239 void TaskGroup::OnProcessPriorityDone(bool is_backgrounded) { | 239 void TaskGroup::OnProcessPriorityDone(bool is_backgrounded) { |
| 240 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 240 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 241 | 241 |
| 242 is_backgrounded_ = is_backgrounded; | 242 is_backgrounded_ = is_backgrounded; |
| 243 } | 243 } |
| 244 | 244 |
| 245 } // namespace task_management | 245 } // namespace task_management |
| OLD | NEW |