| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/base/fake_single_thread_task_runner.h" | 5 #include "media/base/fake_single_thread_task_runner.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/time/tick_clock.h" | 9 #include "base/time/tick_clock.h" |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 // No tasks have the exact same run time, so just do a simple insert. | 51 // No tasks have the exact same run time, so just do a simple insert. |
| 52 tasks_.insert(std::make_pair(TaskKey(run_time, 0), task)); | 52 tasks_.insert(std::make_pair(TaskKey(run_time, 0), task)); |
| 53 return true; | 53 return true; |
| 54 } | 54 } |
| 55 | 55 |
| 56 bool FakeSingleThreadTaskRunner::RunsTasksOnCurrentThread() const { | 56 bool FakeSingleThreadTaskRunner::RunsTasksOnCurrentThread() const { |
| 57 return true; | 57 return true; |
| 58 } | 58 } |
| 59 | 59 |
| 60 std::string FakeSingleThreadTaskRunner::GetThreadName() const { |
| 61 return std::string(); |
| 62 } |
| 63 |
| 60 void FakeSingleThreadTaskRunner::RunTasks() { | 64 void FakeSingleThreadTaskRunner::RunTasks() { |
| 61 while (true) { | 65 while (true) { |
| 62 // Run all tasks equal or older than current time. | 66 // Run all tasks equal or older than current time. |
| 63 const auto it = tasks_.begin(); | 67 const auto it = tasks_.begin(); |
| 64 if (it == tasks_.end()) | 68 if (it == tasks_.end()) |
| 65 return; // No more tasks. | 69 return; // No more tasks. |
| 66 | 70 |
| 67 if (clock_->NowTicks() < it->first.first) | 71 if (clock_->NowTicks() < it->first.first) |
| 68 return; | 72 return; |
| 69 | 73 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 108 |
| 105 bool FakeSingleThreadTaskRunner::PostNonNestableDelayedTask( | 109 bool FakeSingleThreadTaskRunner::PostNonNestableDelayedTask( |
| 106 const tracked_objects::Location& from_here, | 110 const tracked_objects::Location& from_here, |
| 107 const base::Closure& task, | 111 const base::Closure& task, |
| 108 base::TimeDelta delay) { | 112 base::TimeDelta delay) { |
| 109 NOTIMPLEMENTED(); | 113 NOTIMPLEMENTED(); |
| 110 return false; | 114 return false; |
| 111 } | 115 } |
| 112 | 116 |
| 113 } // namespace media | 117 } // namespace media |
| OLD | NEW |