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

Unified Diff: media/cast/test/skewed_single_thread_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
Index: media/cast/test/skewed_single_thread_task_runner.cc
diff --git a/media/cast/test/skewed_single_thread_task_runner.cc b/media/cast/test/skewed_single_thread_task_runner.cc
index fda7dfbfcad16575447c6975538d76c5915e8281..6797d6faa8db8d596e636fb5411bff8dea65c69c 100644
--- a/media/cast/test/skewed_single_thread_task_runner.cc
+++ b/media/cast/test/skewed_single_thread_task_runner.cc
@@ -4,6 +4,8 @@
#include "media/cast/test/skewed_single_thread_task_runner.h"
+#include <utility>
+
#include "base/logging.h"
#include "base/time/tick_clock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -26,11 +28,10 @@ void SkewedSingleThreadTaskRunner::SetSkew(double skew) {
bool SkewedSingleThreadTaskRunner::PostDelayedTask(
const tracked_objects::Location& from_here,
- const base::Closure& task,
+ base::Closure task,
base::TimeDelta delay) {
return task_runner_->PostDelayedTask(
- from_here,
- task,
+ from_here, std::move(task),
base::TimeDelta::FromMicroseconds(delay.InMicroseconds() * skew_));
}
@@ -40,11 +41,10 @@ bool SkewedSingleThreadTaskRunner::RunsTasksOnCurrentThread() const {
bool SkewedSingleThreadTaskRunner::PostNonNestableDelayedTask(
const tracked_objects::Location& from_here,
- const base::Closure& task,
+ base::Closure task,
base::TimeDelta delay) {
return task_runner_->PostNonNestableDelayedTask(
- from_here,
- task,
+ from_here, std::move(task),
base::TimeDelta::FromMicroseconds(delay.InMicroseconds() * skew_));
}
« no previous file with comments | « media/cast/test/skewed_single_thread_task_runner.h ('k') | mojo/public/cpp/bindings/tests/bind_task_runner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698