| Index: chrome/browser/task_management/sampling/task_group_sampler.h
|
| diff --git a/chrome/browser/task_management/sampling/task_group_sampler.h b/chrome/browser/task_management/sampling/task_group_sampler.h
|
| index 6521fe483eea097f6d6093cef82c8f1cfcf2222e..6d7bdccafa23d99fa06dcfcc508b29e46d1f5878 100644
|
| --- a/chrome/browser/task_management/sampling/task_group_sampler.h
|
| +++ b/chrome/browser/task_management/sampling/task_group_sampler.h
|
| @@ -7,6 +7,7 @@
|
|
|
| #include "base/callback.h"
|
| #include "base/memory/ref_counted.h"
|
| +#include "base/process/process.h"
|
| #include "base/process/process_handle.h"
|
| #include "base/process/process_metrics.h"
|
| #include "base/sequence_checker.h"
|
| @@ -39,13 +40,16 @@ class TaskGroupSampler : public base::RefCountedThreadSafe<TaskGroupSampler> {
|
| using OnCpuRefreshCallback = base::Callback<void(double)>;
|
| using OnMemoryRefreshCallback = base::Callback<void(MemoryUsageStats)>;
|
| using OnIdleWakeupsCallback = base::Callback<void(int)>;
|
| + using OnProcessPriorityCallback = base::Callback<void(bool)>;
|
|
|
| TaskGroupSampler(
|
| + base::ProcessId proc_id,
|
| base::ProcessHandle proc_handle,
|
| const scoped_refptr<base::SequencedTaskRunner>& blocking_pool_runner,
|
| const OnCpuRefreshCallback& on_cpu_refresh,
|
| const OnMemoryRefreshCallback& on_memory_refresh,
|
| - const OnIdleWakeupsCallback& on_idle_wakeups);
|
| + const OnIdleWakeupsCallback& on_idle_wakeups,
|
| + const OnProcessPriorityCallback& on_process_priority);
|
|
|
| // Refreshes the expensive process' stats (CPU usage, memory usage, and idle
|
| // wakeups per second) on the worker thread.
|
| @@ -59,6 +63,7 @@ class TaskGroupSampler : public base::RefCountedThreadSafe<TaskGroupSampler> {
|
| double RefreshCpuUsage();
|
| MemoryUsageStats RefreshMemoryUsage();
|
| int RefreshIdleWakeupsPerSecond();
|
| + bool RefreshProcessPriority();
|
|
|
| scoped_ptr<base::ProcessMetrics> process_metrics_;
|
|
|
| @@ -66,11 +71,14 @@ class TaskGroupSampler : public base::RefCountedThreadSafe<TaskGroupSampler> {
|
| // the refresh tasks onto serially.
|
| scoped_refptr<base::SequencedTaskRunner> blocking_pool_runner_;
|
|
|
| + base::Process process_;
|
| +
|
| // The UI-thread callbacks in TaskGroup to be called when their corresponding
|
| // refreshes on the worker thread are done.
|
| const OnCpuRefreshCallback on_cpu_refresh_callback_;
|
| const OnMemoryRefreshCallback on_memory_refresh_callback_;
|
| const OnIdleWakeupsCallback on_idle_wakeups_callback_;
|
| + const OnProcessPriorityCallback on_process_priority_callback_;
|
|
|
| // To assert we're running on the correct thread.
|
| base::SequenceChecker worker_pool_sequenced_checker_;
|
|
|