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

Side by Side Diff: net/quic/chromium/test_task_runner.cc

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 | « net/quic/chromium/test_task_runner.h ('k') | remoting/base/auto_thread_task_runner.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/quic/chromium/test_task_runner.h" 5 #include "net/quic/chromium/test_task_runner.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "net/quic/test_tools/mock_clock.h" 10 #include "net/quic/test_tools/mock_clock.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace net { 13 namespace net {
14 namespace test { 14 namespace test {
15 15
16 TestTaskRunner::TestTaskRunner(MockClock* clock) : clock_(clock) {} 16 TestTaskRunner::TestTaskRunner(MockClock* clock) : clock_(clock) {}
17 17
18 TestTaskRunner::~TestTaskRunner() {} 18 TestTaskRunner::~TestTaskRunner() {}
19 19
20 bool TestTaskRunner::PostDelayedTask(const tracked_objects::Location& from_here, 20 bool TestTaskRunner::PostDelayedTask(const tracked_objects::Location& from_here,
21 base::Closure task, 21 base::OnceClosure task,
22 base::TimeDelta delay) { 22 base::TimeDelta delay) {
23 EXPECT_GE(delay, base::TimeDelta()); 23 EXPECT_GE(delay, base::TimeDelta());
24 tasks_.push_back(PostedTask(from_here, std::move(task), clock_->NowInTicks(), 24 tasks_.push_back(PostedTask(from_here, std::move(task), clock_->NowInTicks(),
25 delay, base::TestPendingTask::NESTABLE)); 25 delay, base::TestPendingTask::NESTABLE));
26 return false; 26 return false;
27 } 27 }
28 28
29 bool TestTaskRunner::RunsTasksOnCurrentThread() const { 29 bool TestTaskRunner::RunsTasksOnCurrentThread() const {
30 return true; 30 return true;
31 } 31 }
(...skipping 24 matching lines...) Expand all
56 56
57 } // namespace 57 } // namespace
58 58
59 std::vector<PostedTask>::iterator TestTaskRunner::FindNextTask() { 59 std::vector<PostedTask>::iterator TestTaskRunner::FindNextTask() {
60 return std::min_element(tasks_.begin(), tasks_.end(), 60 return std::min_element(tasks_.begin(), tasks_.end(),
61 ShouldRunBeforeLessThan()); 61 ShouldRunBeforeLessThan());
62 } 62 }
63 63
64 } // namespace test 64 } // namespace test
65 } // namespace net 65 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/test_task_runner.h ('k') | remoting/base/auto_thread_task_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698