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

Side by Side Diff: components/scheduler/child/task_queue_manager.h

Issue 1340343003: scheduler: Implement WebFrameScheduler and WebPageScheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased + fixed gn build. Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ 5 #ifndef CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_
6 #define CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ 6 #define CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/atomic_sequence_num.h" 10 #include "base/atomic_sequence_num.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 // Returns true if any task from a monitored task queue was was run since the 82 // Returns true if any task from a monitored task queue was was run since the
83 // last call to GetAndClearSystemIsQuiescentBit. 83 // last call to GetAndClearSystemIsQuiescentBit.
84 bool GetAndClearSystemIsQuiescentBit(); 84 bool GetAndClearSystemIsQuiescentBit();
85 85
86 // Creates a task queue with the given |spec|. Must be called on the thread 86 // Creates a task queue with the given |spec|. Must be called on the thread
87 // this class was created on. 87 // this class was created on.
88 scoped_refptr<internal::TaskQueueImpl> NewTaskQueue( 88 scoped_refptr<internal::TaskQueueImpl> NewTaskQueue(
89 const TaskQueue::Spec& spec); 89 const TaskQueue::Spec& spec);
90 90
91 class SCHEDULER_EXPORT Observer {
92 public:
93 virtual ~Observer() {}
94
95 // Called when |queue| is unregistered.
96 virtual void OnUnregisterTaskQueue(
97 const scoped_refptr<internal::TaskQueueImpl>& queue) = 0;
98 };
99
100 // Called once to set the Observer. This function is called on the main
101 // thread. If |observer| is null, then no callbacks will occur.
102 // Note |observer| is expected to outlive the SchedulerHelper.
103 void SetObserver(Observer* observer);
104
91 private: 105 private:
92 friend class internal::LazyNow; 106 friend class internal::LazyNow;
93 friend class internal::TaskQueueImpl; 107 friend class internal::TaskQueueImpl;
94 friend class TaskQueueManagerTest; 108 friend class TaskQueueManagerTest;
95 109
96 class DeletionSentinel : public base::RefCounted<DeletionSentinel> { 110 class DeletionSentinel : public base::RefCounted<DeletionSentinel> {
97 private: 111 private:
98 friend class base::RefCounted<DeletionSentinel>; 112 friend class base::RefCounted<DeletionSentinel>;
99 ~DeletionSentinel() {} 113 ~DeletionSentinel() {}
100 }; 114 };
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 242
229 int work_batch_size_; 243 int work_batch_size_;
230 244
231 scoped_ptr<base::TickClock> time_source_; 245 scoped_ptr<base::TickClock> time_source_;
232 246
233 base::ObserverList<base::MessageLoop::TaskObserver> task_observers_; 247 base::ObserverList<base::MessageLoop::TaskObserver> task_observers_;
234 248
235 const char* disabled_by_default_tracing_category_; 249 const char* disabled_by_default_tracing_category_;
236 const char* disabled_by_default_verbose_tracing_category_; 250 const char* disabled_by_default_verbose_tracing_category_;
237 251
252 Observer* observer_; // NOT OWNED
238 scoped_refptr<DeletionSentinel> deletion_sentinel_; 253 scoped_refptr<DeletionSentinel> deletion_sentinel_;
239 base::WeakPtrFactory<TaskQueueManager> weak_factory_; 254 base::WeakPtrFactory<TaskQueueManager> weak_factory_;
240 255
241 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager); 256 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager);
242 }; 257 };
243 258
244 } // namespace scheduler 259 } // namespace scheduler
245 260
246 #endif // CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ 261 #endif // CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_
OLDNEW
« no previous file with comments | « components/scheduler/child/task_queue_impl.cc ('k') | components/scheduler/child/task_queue_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698