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

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: Added some tests 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..117bb6d2bd9677a966f2a6bd3f0adb4c1d9c3659 100644
--- a/components/scheduler/child/task_queue_manager.h
+++ b/components/scheduler/child/task_queue_manager.h
@@ -88,6 +88,19 @@ 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.
Sami 2015/09/10 15:10:23 nit: also mention the lifetime here.
alex clarke (OOO till 29th) 2015/09/10 15:56:24 Done.
+ void SetQueueObserver(Observer* observer);
+
private:
friend class internal::LazyNow;
friend class internal::TaskQueueImpl;
@@ -231,6 +244,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