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"
13 class SCHEDULER_EXPORT NullTaskQueue
: public TaskQueue
{
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 bool IsQueueEnabled() const override
;
30 QueueState
GetQueueState() const override
;
31 const char* GetName() const override
;
32 void SetQueuePriority(QueuePriority priority
) override
;
33 void PumpQueue() override
;
34 void SetPumpPolicy(PumpPolicy pump_policy
) override
;
37 ~NullTaskQueue() override
;
39 scoped_refptr
<base::SingleThreadTaskRunner
> task_runner_
;
41 DISALLOW_COPY_AND_ASSIGN(NullTaskQueue
);
44 } // namespace scheduler
46 #endif // COMPONENTS_SCHEDULER_CHILD_NULL_TASK_QUEUE_H_