Index: mojo/public/cpp/bindings/tests/bind_task_runner_unittest.cc |
diff --git a/mojo/public/cpp/bindings/tests/bind_task_runner_unittest.cc b/mojo/public/cpp/bindings/tests/bind_task_runner_unittest.cc |
index dab64f012d16f86364bfc529f6493481b877f1be..96ae8189ad0fb8d6333290e71f496ff56c39be44 100644 |
--- a/mojo/public/cpp/bindings/tests/bind_task_runner_unittest.cc |
+++ b/mojo/public/cpp/bindings/tests/bind_task_runner_unittest.cc |
@@ -31,18 +31,18 @@ class TestTaskRunner : public base::SingleThreadTaskRunner { |
base::WaitableEvent::InitialState::NOT_SIGNALED) {} |
bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, |
- const base::Closure& task, |
+ base::OnceClosure task, |
base::TimeDelta delay) override { |
NOTREACHED(); |
return false; |
} |
bool PostDelayedTask(const tracked_objects::Location& from_here, |
- const base::Closure& task, |
+ base::OnceClosure task, |
base::TimeDelta delay) override { |
{ |
base::AutoLock locker(lock_); |
- tasks_.push(task); |
+ tasks_.push(std::move(task)); |
} |
task_ready_.Signal(); |
return true; |
@@ -60,12 +60,12 @@ class TestTaskRunner : public base::SingleThreadTaskRunner { |
{ |
base::AutoLock locker(lock_); |
while (!tasks_.empty()) { |
- auto task = tasks_.front(); |
+ auto task = std::move(tasks_.front()); |
tasks_.pop(); |
{ |
base::AutoUnlock unlocker(lock_); |
- task.Run(); |
+ std::move(task).Run(); |
if (quit_called_) |
return; |
} |
@@ -88,12 +88,12 @@ class TestTaskRunner : public base::SingleThreadTaskRunner { |
{ |
base::AutoLock locker(lock_); |
if (!tasks_.empty()) { |
- auto task = tasks_.front(); |
+ auto task = std::move(tasks_.front()); |
tasks_.pop(); |
{ |
base::AutoUnlock unlocker(lock_); |
- task.Run(); |
+ std::move(task).Run(); |
return; |
} |
} |
@@ -111,7 +111,7 @@ class TestTaskRunner : public base::SingleThreadTaskRunner { |
// Protect |tasks_|. |
base::Lock lock_; |
- std::queue<base::Closure> tasks_; |
+ std::queue<base::OnceClosure> tasks_; |
DISALLOW_COPY_AND_ASSIGN(TestTaskRunner); |
}; |