| Index: base/pending_task.cc
|
| diff --git a/base/pending_task.cc b/base/pending_task.cc
|
| index d21f7c7f0d9b61a3ad365ff218b54dd4014f7918..73834bd46071ab61c0f902b599497a72a494c35c 100644
|
| --- a/base/pending_task.cc
|
| +++ b/base/pending_task.cc
|
| @@ -9,9 +9,9 @@
|
| namespace base {
|
|
|
| PendingTask::PendingTask(const tracked_objects::Location& posted_from,
|
| - const base::Closure& task)
|
| + base::Closure task)
|
| : base::TrackingInfo(posted_from, TimeTicks()),
|
| - task(task),
|
| + task(std::move(task)),
|
| posted_from(posted_from),
|
| sequence_num(0),
|
| nestable(true),
|
| @@ -19,22 +19,24 @@ PendingTask::PendingTask(const tracked_objects::Location& posted_from,
|
| }
|
|
|
| PendingTask::PendingTask(const tracked_objects::Location& posted_from,
|
| - const base::Closure& task,
|
| + base::Closure task,
|
| TimeTicks delayed_run_time,
|
| bool nestable)
|
| : base::TrackingInfo(posted_from, delayed_run_time),
|
| - task(task),
|
| + task(std::move(task)),
|
| posted_from(posted_from),
|
| sequence_num(0),
|
| nestable(nestable),
|
| is_high_res(false) {
|
| }
|
|
|
| -PendingTask::PendingTask(const PendingTask& other) = default;
|
| +PendingTask::PendingTask(PendingTask&& other) = default;
|
|
|
| PendingTask::~PendingTask() {
|
| }
|
|
|
| +PendingTask& PendingTask::operator=(PendingTask&& other) = default;
|
| +
|
| bool PendingTask::operator<(const PendingTask& other) const {
|
| // Since the top of a priority queue is defined as the "greatest" element, we
|
| // need to invert the comparison here. We want the smaller time to be at the
|
| @@ -51,8 +53,4 @@ bool PendingTask::operator<(const PendingTask& other) const {
|
| return (sequence_num - other.sequence_num) > 0;
|
| }
|
|
|
| -void TaskQueue::Swap(TaskQueue* queue) {
|
| - c.swap(queue->c); // Calls std::deque::swap.
|
| -}
|
| -
|
| } // namespace base
|
|
|