Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(749)

Side by Side Diff: media/base/fake_single_thread_task_runner.cc

Issue 2823103003: Introduce TaskRunner::RunsTasksInCurrentSequence() (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <utility> 7 #include <utility>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 return true; 48 return true;
49 } 49 }
50 } 50 }
51 } 51 }
52 52
53 // No tasks have the exact same run time, so just do a simple insert. 53 // No tasks have the exact same run time, so just do a simple insert.
54 tasks_.insert(std::make_pair(TaskKey(run_time, 0), std::move(task))); 54 tasks_.insert(std::make_pair(TaskKey(run_time, 0), std::move(task)));
55 return true; 55 return true;
56 } 56 }
57 57
58 bool FakeSingleThreadTaskRunner::RunsTasksOnCurrentThread() const { 58 bool FakeSingleThreadTaskRunner::RunsTasksInCurrentSequence() const {
59 return true; 59 return true;
60 } 60 }
61 61
62 void FakeSingleThreadTaskRunner::RunTasks() { 62 void FakeSingleThreadTaskRunner::RunTasks() {
63 while (true) { 63 while (true) {
64 // Run all tasks equal or older than current time. 64 // Run all tasks equal or older than current time.
65 const auto it = tasks_.begin(); 65 const auto it = tasks_.begin();
66 if (it == tasks_.end()) 66 if (it == tasks_.end())
67 return; // No more tasks. 67 return; // No more tasks.
68 68
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 bool FakeSingleThreadTaskRunner::PostNonNestableDelayedTask( 107 bool FakeSingleThreadTaskRunner::PostNonNestableDelayedTask(
108 const tracked_objects::Location& from_here, 108 const tracked_objects::Location& from_here,
109 base::OnceClosure task, 109 base::OnceClosure task,
110 base::TimeDelta delay) { 110 base::TimeDelta delay) {
111 NOTIMPLEMENTED(); 111 NOTIMPLEMENTED();
112 return false; 112 return false;
113 } 113 }
114 114
115 } // namespace media 115 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698