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..ede2dd948fedaf230a3a2645e9a83c10cb959749 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,15 @@ 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::ProcessHandle proc_handle, |
+ base::Process process, |
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 +62,11 @@ class TaskGroupSampler : public base::RefCountedThreadSafe<TaskGroupSampler> { |
double RefreshCpuUsage(); |
MemoryUsageStats RefreshMemoryUsage(); |
int RefreshIdleWakeupsPerSecond(); |
+ bool RefreshProcessPriority(); |
+ |
+ // The process that holds the handle that we own so that we can use it for |
+ // creating the ProcessMetrics. |
+ base::Process process_; |
scoped_ptr<base::ProcessMetrics> process_metrics_; |
@@ -71,6 +79,7 @@ class TaskGroupSampler : public base::RefCountedThreadSafe<TaskGroupSampler> { |
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_; |