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

Unified Diff: components/scheduler/child/task_queue_manager.h

Issue 1314903007: Implement WebFrameScheduler and WebPageScheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Responding to feedback Created 5 years, 3 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: components/scheduler/child/task_queue_manager.h
diff --git a/components/scheduler/child/task_queue_manager.h b/components/scheduler/child/task_queue_manager.h
index 384074fbc7e184bd93c1663a0eceb9c54b8face7..f7b89ba46eea6d9b6d2b4f98f37f92c4d11786f1 100644
--- a/components/scheduler/child/task_queue_manager.h
+++ b/components/scheduler/child/task_queue_manager.h
@@ -88,6 +88,20 @@ class SCHEDULER_EXPORT TaskQueueManager
scoped_refptr<internal::TaskQueueImpl> NewTaskQueue(
const TaskQueue::Spec& spec);
+ class SCHEDULER_EXPORT Observer {
+ public:
+ virtual ~Observer() {}
+
+ // Called when |queue| is unregistered.
+ virtual void OnUnregisterTaskQueue(
+ const scoped_refptr<internal::TaskQueueImpl>& queue) = 0;
+ };
+
+ // Called once to set the Observer. This function is called on the main
+ // thread. If |observer| is null, then no callbacks will occur.
+ // Note |observer| is expected to outlive the SchedulerHelper.
+ void SetQueueObserver(Observer* observer);
+
private:
friend class internal::LazyNow;
friend class internal::TaskQueueImpl;
@@ -231,6 +245,7 @@ class SCHEDULER_EXPORT TaskQueueManager
const char* disabled_by_default_tracing_category_;
const char* disabled_by_default_verbose_tracing_category_;
+ Observer* queue_observer_; // NOT OWNED
scoped_refptr<DeletionSentinel> deletion_sentinel_;
base::WeakPtrFactory<TaskQueueManager> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698