| Index: chrome/browser/task_management/sampling/task_group.cc
|
| diff --git a/chrome/browser/task_management/sampling/task_group.cc b/chrome/browser/task_management/sampling/task_group.cc
|
| index 45c596f9717214f92cdb34eb134f0715f41a6456..76ee60ae42ae82d00ef23b749858f4a809b4659a 100644
|
| --- a/chrome/browser/task_management/sampling/task_group.cc
|
| +++ b/chrome/browser/task_management/sampling/task_group.cc
|
| @@ -74,15 +74,19 @@ TaskGroup::TaskGroup(
|
| #endif // !defined(DISABLE_NACL)
|
| idle_wakeups_per_second_(-1),
|
| gpu_memory_has_duplicates_(false),
|
| + is_backgrounded_(false),
|
| weak_ptr_factory_(this) {
|
| scoped_refptr<TaskGroupSampler> sampler(
|
| - new TaskGroupSampler(proc_handle,
|
| + new TaskGroupSampler(proc_id,
|
| + proc_handle,
|
| blocking_pool_runner,
|
| base::Bind(&TaskGroup::OnCpuRefreshDone,
|
| weak_ptr_factory_.GetWeakPtr()),
|
| base::Bind(&TaskGroup::OnMemoryUsageRefreshDone,
|
| weak_ptr_factory_.GetWeakPtr()),
|
| base::Bind(&TaskGroup::OnIdleWakeupsRefreshDone,
|
| + weak_ptr_factory_.GetWeakPtr()),
|
| + base::Bind(&TaskGroup::OnProcessPriorityDone,
|
| weak_ptr_factory_.GetWeakPtr())));
|
| worker_thread_sampler_.swap(sampler);
|
| }
|
| @@ -139,6 +143,7 @@ void TaskGroup::Refresh(
|
| // 5- CPU usage.
|
| // 6- Memory usage.
|
| // 7- Idle Wakeups per second.
|
| + // 8- Process priority (foreground vs. background).
|
| worker_thread_sampler_->Refresh(refresh_flags);
|
| }
|
|
|
| @@ -205,4 +210,10 @@ void TaskGroup::OnIdleWakeupsRefreshDone(int idle_wakeups_per_second) {
|
| idle_wakeups_per_second_ = idle_wakeups_per_second;
|
| }
|
|
|
| +void TaskGroup::OnProcessPriorityDone(bool is_backgrounded) {
|
| + DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
| +
|
| + is_backgrounded_ = is_backgrounded;
|
| +}
|
| +
|
| } // namespace task_management
|
|
|