| Index: chrome/browser/after_startup_task_utils.cc
|
| diff --git a/chrome/browser/after_startup_task_utils.cc b/chrome/browser/after_startup_task_utils.cc
|
| index c5c29e8b8cb599f7305a2df9b0a82abce8dd1e7c..e024a945968ccb901ceabca657df8747f36288c3 100644
|
| --- a/chrome/browser/after_startup_task_utils.cc
|
| +++ b/chrome/browser/after_startup_task_utils.cc
|
| @@ -34,13 +34,13 @@ namespace {
|
| struct AfterStartupTask {
|
| AfterStartupTask(const tracked_objects::Location& from_here,
|
| const scoped_refptr<base::TaskRunner>& task_runner,
|
| - const base::Closure& task)
|
| - : from_here(from_here), task_runner(task_runner), task(task) {}
|
| + base::Closure task)
|
| + : from_here(from_here), task_runner(task_runner), task(std::move(task)) {}
|
| ~AfterStartupTask() {}
|
|
|
| const tracked_objects::Location from_here;
|
| const scoped_refptr<base::TaskRunner> task_runner;
|
| - const base::Closure task;
|
| + base::Closure task;
|
| };
|
|
|
| // The flag may be read on any thread, but must only be set on the UI thread.
|
| @@ -60,7 +60,7 @@ bool IsBrowserStartupComplete() {
|
| void RunTask(std::unique_ptr<AfterStartupTask> queued_task) {
|
| // We're careful to delete the caller's |task| on the target runner's thread.
|
| DCHECK(queued_task->task_runner->RunsTasksOnCurrentThread());
|
| - queued_task->task.Run();
|
| + std::move(queued_task->task).Run();
|
| }
|
|
|
| void ScheduleTask(std::unique_ptr<AfterStartupTask> queued_task) {
|
| @@ -202,10 +202,11 @@ AfterStartupTaskUtils::Runner::~Runner() = default;
|
|
|
| bool AfterStartupTaskUtils::Runner::PostDelayedTask(
|
| const tracked_objects::Location& from_here,
|
| - const base::Closure& task,
|
| + base::Closure task,
|
| base::TimeDelta delay) {
|
| DCHECK(delay.is_zero());
|
| - AfterStartupTaskUtils::PostTask(from_here, destination_runner_, task);
|
| + AfterStartupTaskUtils::PostTask(from_here, destination_runner_,
|
| + std::move(task));
|
| return true;
|
| }
|
|
|
| @@ -221,14 +222,14 @@ void AfterStartupTaskUtils::StartMonitoringStartup() {
|
| void AfterStartupTaskUtils::PostTask(
|
| const tracked_objects::Location& from_here,
|
| const scoped_refptr<base::TaskRunner>& destination_runner,
|
| - const base::Closure& task) {
|
| + base::Closure task) {
|
| if (IsBrowserStartupComplete()) {
|
| - destination_runner->PostTask(from_here, task);
|
| + destination_runner->PostTask(from_here, std::move(task));
|
| return;
|
| }
|
|
|
| std::unique_ptr<AfterStartupTask> queued_task(
|
| - new AfterStartupTask(from_here, destination_runner, task));
|
| + new AfterStartupTask(from_here, destination_runner, std::move(task)));
|
| QueueTask(std::move(queued_task));
|
| }
|
|
|
|
|