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

Side by Side Diff: base/test/test_mock_time_task_runner.h

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (Closed)
Patch Set: rebase Created 3 years, 8 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
« no previous file with comments | « base/test/scoped_task_scheduler.cc ('k') | base/test/test_mock_time_task_runner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 #ifndef BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_ 5 #ifndef BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_
6 #define BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_ 6 #define BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <deque> 10 #include <deque>
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 std::unique_ptr<TickClock> GetMockTickClock() const; 134 std::unique_ptr<TickClock> GetMockTickClock() const;
135 135
136 std::deque<TestPendingTask> TakePendingTasks(); 136 std::deque<TestPendingTask> TakePendingTasks();
137 bool HasPendingTask() const; 137 bool HasPendingTask() const;
138 size_t GetPendingTaskCount() const; 138 size_t GetPendingTaskCount() const;
139 TimeDelta NextPendingTaskDelay() const; 139 TimeDelta NextPendingTaskDelay() const;
140 140
141 // SingleThreadTaskRunner: 141 // SingleThreadTaskRunner:
142 bool RunsTasksOnCurrentThread() const override; 142 bool RunsTasksOnCurrentThread() const override;
143 bool PostDelayedTask(const tracked_objects::Location& from_here, 143 bool PostDelayedTask(const tracked_objects::Location& from_here,
144 Closure task, 144 OnceClosure task,
145 TimeDelta delay) override; 145 TimeDelta delay) override;
146 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, 146 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
147 Closure task, 147 OnceClosure task,
148 TimeDelta delay) override; 148 TimeDelta delay) override;
149 149
150 protected: 150 protected:
151 ~TestMockTimeTaskRunner() override; 151 ~TestMockTimeTaskRunner() override;
152 152
153 // Whether the elapsing of virtual time is stopped or not. Subclasses can 153 // Whether the elapsing of virtual time is stopped or not. Subclasses can
154 // override this method to perform early exits from a running task runner. 154 // override this method to perform early exits from a running task runner.
155 // Defaults to always return false. 155 // Defaults to always return false.
156 virtual bool IsElapsingStopped(); 156 virtual bool IsElapsingStopped();
157 157
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 size_t next_task_ordinal_; 215 size_t next_task_ordinal_;
216 216
217 Lock tasks_lock_; 217 Lock tasks_lock_;
218 218
219 DISALLOW_COPY_AND_ASSIGN(TestMockTimeTaskRunner); 219 DISALLOW_COPY_AND_ASSIGN(TestMockTimeTaskRunner);
220 }; 220 };
221 221
222 } // namespace base 222 } // namespace base
223 223
224 #endif // BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_ 224 #endif // BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_
OLDNEW
« no previous file with comments | « base/test/scoped_task_scheduler.cc ('k') | base/test/test_mock_time_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698