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

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

Issue 1584473004: Migrate ProcessesEventRouter to the new task manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nit. Created 4 years, 9 months 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.h
diff --git a/chrome/browser/task_management/sampling/task_group.h b/chrome/browser/task_management/sampling/task_group.h
index a9276fdf01deddd1d554d62fb446227b4329718c..4d6eed2f1f65c81fd126e6f17f3925c0772723b1 100644
--- a/chrome/browser/task_management/sampling/task_group.h
+++ b/chrome/browser/task_management/sampling/task_group.h
@@ -32,6 +32,7 @@ class TaskGroup {
TaskGroup(
base::ProcessHandle proc_handle,
base::ProcessId proc_id,
+ const base::Closure& on_background_calculations_done,
const scoped_refptr<base::SequencedTaskRunner>& blocking_pool_runner);
~TaskGroup();
@@ -50,6 +51,15 @@ class TaskGroup {
Task* GetTaskById(TaskId task_id) const;
+ // This is to be called after the task manager had informed its observers with
+ // OnTasksRefreshedWithBackgroundCalculations() to begin another cycle for
+ // this notification type.
+ void ClearCurrentBackgroundCalculationsFlags();
+
+ // True if all enabled background operations calculating resource usage of the
+ // process represented by this TaskGroup have completed.
+ bool AreBackgroundCalculationsDone() const;
+
const base::ProcessHandle& process_handle() const { return process_handle_; }
const base::ProcessId& process_id() const { return process_id_; }
@@ -104,16 +114,27 @@ class TaskGroup {
void OnProcessPriorityDone(bool is_backgrounded);
+ void OnBackgroundRefreshTypeFinished(int64_t finished_refresh_type);
+
// The process' handle and ID.
base::ProcessHandle process_handle_;
base::ProcessId process_id_;
+ // This is a callback into the TaskManagerImpl to inform it that the
+ // background calculations for this TaskGroup has finished.
+ const base::Closure on_background_calculations_done_;
+
scoped_refptr<TaskGroupSampler> worker_thread_sampler_;
// Maps the Tasks by their IDs.
// Tasks are not owned by the TaskGroup. They're owned by the TaskProviders.
std::map<TaskId, Task*> tasks_;
+ // Flags will be used to determine when the background calculations has
+ // completed for the enabled refresh types for this TaskGroup.
+ int64_t expected_on_bg_done_flags_;
+ int64_t current_on_bg_done_flags_;
+
// The per process resources usages.
double cpu_usage_;
MemoryUsageStats memory_usage_;

Powered by Google App Engine
This is Rietveld 408576698