Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5582)

Unified Diff: chrome/browser/task_management/sampling/task_group_sampler.h

Issue 1374283003: Reporting top cpu and memory consumers via rappor on chromeos (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Turn off ResourceReporter on task_management CrOs browser_tests. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_;
« no previous file with comments | « chrome/browser/task_management/sampling/task_group.cc ('k') | chrome/browser/task_management/sampling/task_group_sampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698