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

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

Issue 2726523002: Pass Callback to TaskRunner by value and consume it on invocation (1) (Closed)
Patch Set: erase Closure* Created 3 years, 9 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') | remoting/base/auto_thread_task_runner.h » ('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 aed7b8fc9f09239e12c1cbd50d7ea0a0a1de8877..61d0700e1fa38fedec7849c04d6056bee690f28d 100644
--- a/net/quic/test_tools/test_task_runner.cc
+++ b/net/quic/test_tools/test_task_runner.cc
@@ -5,6 +5,7 @@
#include "net/quic/test_tools/test_task_runner.h"
#include <algorithm>
+#include <utility>
#include "net/quic/test_tools/mock_clock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -17,11 +18,11 @@ TestTaskRunner::TestTaskRunner(MockClock* clock) : clock_(clock) {}
TestTaskRunner::~TestTaskRunner() {}
bool TestTaskRunner::PostDelayedTask(const tracked_objects::Location& from_here,
- const base::Closure& task,
+ base::Closure 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;
}
« no previous file with comments | « net/quic/test_tools/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