Implement PostDelayedTaskAt for guaranteed timer ordering
[chromium-blink-merge.git] / components / scheduler / child / null_task_queue.h
blob7c4e5d8adfb190209c41a6cbde8c1a1abe4d3418
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_SCHEDULER_NULL_CHILD_TASK_QUEUE_H_
6 #define COMPONENTS_SCHEDULER_NULL_CHILD_TASK_QUEUE_H_
8 #include "components/scheduler/child/task_queue.h"
9 #include "components/scheduler/scheduler_export.h"
11 namespace scheduler {
13 class SCHEDULER_EXPORT NullTaskQueue : public TaskQueue {
14 public:
15 NullTaskQueue(scoped_refptr<base::SingleThreadTaskRunner> task_runner);
17 // TaskQueue implementation
18 bool RunsTasksOnCurrentThread() const override;
19 bool PostDelayedTask(const tracked_objects::Location& from_here,
20 const base::Closure& task,
21 base::TimeDelta delay) override;
22 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
23 const base::Closure& task,
24 base::TimeDelta delay) override;
25 bool PostDelayedTaskAt(const tracked_objects::Location& from_here,
26 const base::Closure& task,
27 base::TimeTicks desired_run_time) override;
29 protected:
30 ~NullTaskQueue() override;
32 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
34 DISALLOW_COPY_AND_ASSIGN(NullTaskQueue);
37 } // namespace scheduler
39 #endif // COMPONENTS_SCHEDULER_CHILD_NULL_TASK_QUEUE_H_