[MediaRouter] Update MR-2-Extension's PostMessage to return boolean.
[chromium-blink-merge.git] / chromecast / media / cma / base / simple_media_task_runner.h
blob67979f70f1d67bcf808e8e5c53ccd519ae131639
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"
12 namespace base {
13 class SingleThreadTaskRunner;
14 } // namespace base
16 namespace chromecast {
17 namespace media {
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 {
22 public:
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;
31 private:
32 ~SimpleMediaTaskRunner() override;
34 scoped_refptr<base::SingleThreadTaskRunner> const task_runner_;
36 DISALLOW_COPY_AND_ASSIGN(SimpleMediaTaskRunner);
39 } // namespace media
40 } // namespace chromecast
42 #endif // CHROMECAST_MEDIA_CMA_BASE_SIMPLE_MEDIA_TASK_RUNNER_H_