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

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

Issue 1424053002: Adds a flag to support "Virtual Time" to the blink scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased 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
« no previous file with comments | « components/scheduler/base/task_queue_impl.cc ('k') | components/scheduler/base/task_queue_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/base/task_queue_manager.h
diff --git a/components/scheduler/base/task_queue_manager.h b/components/scheduler/base/task_queue_manager.h
index f41567400f5270eaa951979ff0ea12dab20cc6ca..88737a336b76fc5d39ba6b22c179f6d2d84c1b98 100644
--- a/components/scheduler/base/task_queue_manager.h
+++ b/components/scheduler/base/task_queue_manager.h
@@ -34,7 +34,7 @@ class LazyNow;
class TaskQueueImpl;
} // namespace internal
-class NestableSingleThreadTaskRunner;
+class TaskQueueManagerDelegate;
// The task queue manager provides N task queues and a selector interface for
// choosing which task queue to service next. Each task queue consists of two
@@ -51,14 +51,13 @@ class NestableSingleThreadTaskRunner;
class SCHEDULER_EXPORT TaskQueueManager
: public internal::TaskQueueSelector::Observer {
public:
- // Create a task queue manager where |main_task_runner| identifies the thread
+ // Create a task queue manager where |delegate| identifies the thread
// on which where the tasks are eventually run. Category strings must have
// application lifetime (statics or literals). They may not include " chars.
- TaskQueueManager(
- scoped_refptr<NestableSingleThreadTaskRunner> main_task_runner,
- const char* tracing_category,
- const char* disabled_by_default_tracing_category,
- const char* disabled_by_default_verbose_tracing_category);
+ TaskQueueManager(scoped_refptr<TaskQueueManagerDelegate> delegate,
+ const char* tracing_category,
+ const char* disabled_by_default_tracing_category,
+ const char* disabled_by_default_verbose_tracing_category);
~TaskQueueManager() override;
// Returns the time of the next pending delayed task in any queue. Ignores
@@ -78,8 +77,6 @@ class SCHEDULER_EXPORT TaskQueueManager
void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer);
void RemoveTaskObserver(base::MessageLoop::TaskObserver* task_observer);
- void SetTimeSourceForTesting(scoped_ptr<base::TickClock> time_source);
-
// Returns true if any task from a monitored task queue was was run since the
// last call to GetAndClearSystemIsQuiescentBit.
bool GetAndClearSystemIsQuiescentBit();
@@ -103,6 +100,9 @@ class SCHEDULER_EXPORT TaskQueueManager
// Note |observer| is expected to outlive the SchedulerHelper.
void SetObserver(Observer* observer);
+ // Returns the TickClock used by the TaskQueueManager.
+ base::TickClock* tick_clock() const;
+
private:
friend class internal::LazyNow;
friend class internal::TaskQueueImpl;
@@ -160,15 +160,10 @@ class SCHEDULER_EXPORT TaskQueueManager
internal::TaskQueueImpl::Task* out_previous_task);
bool RunsTasksOnCurrentThread() const;
- bool PostDelayedTask(const tracked_objects::Location& from_here,
- const base::Closure& task,
- base::TimeDelta delay);
bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
const base::Closure& task,
base::TimeDelta delay);
- base::TimeTicks Now() const;
-
int GetNextSequenceNumber();
scoped_refptr<base::trace_event::ConvertableToTraceFormat>
@@ -224,7 +219,7 @@ class SCHEDULER_EXPORT TaskQueueManager
base::debug::TaskAnnotator task_annotator_;
base::ThreadChecker main_thread_checker_;
- scoped_refptr<NestableSingleThreadTaskRunner> main_task_runner_;
+ scoped_refptr<TaskQueueManagerDelegate> delegate_;
internal::TaskQueueSelector selector_;
base::Closure decrement_pending_and_do_work_closure_;
@@ -238,8 +233,6 @@ class SCHEDULER_EXPORT TaskQueueManager
int work_batch_size_;
- scoped_ptr<base::TickClock> time_source_;
-
base::ObserverList<base::MessageLoop::TaskObserver> task_observers_;
const char* tracing_category_;
« no previous file with comments | « components/scheduler/base/task_queue_impl.cc ('k') | components/scheduler/base/task_queue_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698