| 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_group_sampler.h" | 5 #include "chrome/browser/task_manager/sampling/task_group_sampler.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 #if defined(OS_LINUX) | 174 #if defined(OS_LINUX) |
| 175 int TaskGroupSampler::RefreshOpenFdCount() { | 175 int TaskGroupSampler::RefreshOpenFdCount() { |
| 176 DCHECK(worker_pool_sequenced_checker_.CalledOnValidSequence()); | 176 DCHECK(worker_pool_sequenced_checker_.CalledOnValidSequence()); |
| 177 | 177 |
| 178 return process_metrics_->GetOpenFdCount(); | 178 return process_metrics_->GetOpenFdCount(); |
| 179 } | 179 } |
| 180 #endif // defined(OS_LINUX) | 180 #endif // defined(OS_LINUX) |
| 181 | 181 |
| 182 bool TaskGroupSampler::RefreshProcessPriority() { | 182 bool TaskGroupSampler::RefreshProcessPriority() { |
| 183 DCHECK(worker_pool_sequenced_checker_.CalledOnValidSequence()); | 183 DCHECK(worker_pool_sequenced_checker_.CalledOnValidSequence()); |
| 184 | 184 #if defined(OS_MACOSX) |
| 185 return process_.IsProcessBackgrounded( |
| 186 content::BrowserChildProcessHost::GetPortProvider()); |
| 187 #else |
| 185 return process_.IsProcessBackgrounded(); | 188 return process_.IsProcessBackgrounded(); |
| 189 #endif // defined(OS_MACOSX) |
| 186 } | 190 } |
| 187 | 191 |
| 188 } // namespace task_manager | 192 } // namespace task_manager |
| OLD | NEW |