OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CHROMECAST_MEDIA_CMA_BASE_SIMPLE_MEDIA_TASK_RUNNER_H_ |
| 6 #define CHROMECAST_MEDIA_CMA_BASE_SIMPLE_MEDIA_TASK_RUNNER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "chromecast/media/cma/base/media_task_runner.h" |
| 11 |
| 12 namespace base { |
| 13 class SingleThreadTaskRunner; |
| 14 } // namespace base |
| 15 |
| 16 namespace chromecast { |
| 17 namespace media { |
| 18 |
| 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); |
| 25 |
| 26 // MediaTaskRunner implementation. |
| 27 bool PostMediaTask(const tracked_objects::Location& from_here, |
| 28 const base::Closure& task, |
| 29 base::TimeDelta timestamp) override; |
| 30 |
| 31 private: |
| 32 ~SimpleMediaTaskRunner() override; |
| 33 |
| 34 scoped_refptr<base::SingleThreadTaskRunner> const task_runner_; |
| 35 |
| 36 DISALLOW_COPY_AND_ASSIGN(SimpleMediaTaskRunner); |
| 37 }; |
| 38 |
| 39 } // namespace media |
| 40 } // namespace chromecast |
| 41 |
| 42 #endif // CHROMECAST_MEDIA_CMA_BASE_SIMPLE_MEDIA_TASK_RUNNER_H_ |
OLD | NEW |