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 CHROMECAST_MEDIA_CMA_BASE_SIMPLE_MEDIA_TASK_RUNNER_H_
6 #define CHROMECAST_MEDIA_CMA_BASE_SIMPLE_MEDIA_TASK_RUNNER_H_
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "chromecast/media/cma/base/media_task_runner.h"
13 class SingleThreadTaskRunner
;
16 namespace chromecast
{
19 // This is a light version of task runner which post tasks immediately
20 // by ignoring the timestamps once receiving the request.
21 class SimpleMediaTaskRunner
: public MediaTaskRunner
{
23 SimpleMediaTaskRunner(
24 const scoped_refptr
<base::SingleThreadTaskRunner
>& task_runner
);
26 // MediaTaskRunner implementation.
27 bool PostMediaTask(const tracked_objects::Location
& from_here
,
28 const base::Closure
& task
,
29 base::TimeDelta timestamp
) override
;
32 ~SimpleMediaTaskRunner() override
;
34 scoped_refptr
<base::SingleThreadTaskRunner
> const task_runner_
;
36 DISALLOW_COPY_AND_ASSIGN(SimpleMediaTaskRunner
);
40 } // namespace chromecast
42 #endif // CHROMECAST_MEDIA_CMA_BASE_SIMPLE_MEDIA_TASK_RUNNER_H_