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

Unified Diff: net/quic/test_tools/test_task_runner.cc

Issue 2122543002: Replace Closure in TaskRunner::PostTask with OneShotCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@07_oneshot
Patch Set: fix Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/test_tools/test_task_runner.h ('k') | net/ssl/channel_id_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/test_tools/test_task_runner.cc
diff --git a/net/quic/test_tools/test_task_runner.cc b/net/quic/test_tools/test_task_runner.cc
index 5e6e647d9c7f98895cb35a41e6507f34f21c871c..fdaca762ef5ad9573819cfb8d64fdaa9df41c0f6 100644
--- a/net/quic/test_tools/test_task_runner.cc
+++ b/net/quic/test_tools/test_task_runner.cc
@@ -17,11 +17,11 @@ TestTaskRunner::TestTaskRunner(MockClock* clock) : clock_(clock) {}
TestTaskRunner::~TestTaskRunner() {}
bool TestTaskRunner::PostDelayedTask(const tracked_objects::Location& from_here,
- const base::Closure& task,
+ base::OnceClosure task,
base::TimeDelta delay) {
EXPECT_GE(delay, base::TimeDelta());
- tasks_.push_back(PostedTask(from_here, task, clock_->NowInTicks(), delay,
- base::TestPendingTask::NESTABLE));
+ tasks_.push_back(PostedTask(from_here, std::move(task), clock_->NowInTicks(),
+ delay, base::TestPendingTask::NESTABLE));
return false;
}
@@ -40,9 +40,9 @@ void TestTaskRunner::RunNextTask() {
DCHECK(next != tasks_.end());
clock_->AdvanceTime(QuicTime::Delta::FromMicroseconds(
(next->GetTimeToRun() - clock_->NowInTicks()).InMicroseconds()));
- PostedTask task = *next;
+ PostedTask task = std::move(*next);
tasks_.erase(next);
- task.task.Run();
+ std::move(task.task).Run();
}
namespace {
« no previous file with comments | « net/quic/test_tools/test_task_runner.h ('k') | net/ssl/channel_id_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698