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

Unified Diff: base/timer/timer.cc

Issue 2791243002: Rewrite base::Bind into base::BindOnce on trivial cases in base (Closed)
Patch Set: rebase Created 3 years, 8 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 | « base/threading/worker_pool_unittest.cc ('k') | base/trace_event/memory_dump_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/timer/timer.cc
diff --git a/base/timer/timer.cc b/base/timer/timer.cc
index 6ec18f181488c3a5b533abe93cf9b793914e6451..31eec1bb574e83b32308dfbb3a94e335d550499c 100644
--- a/base/timer/timer.cc
+++ b/base/timer/timer.cc
@@ -170,13 +170,16 @@ void Timer::PostNewScheduledTask(TimeDelta delay) {
is_running_ = true;
scheduled_task_ = new BaseTimerTaskInternal(this);
if (delay > TimeDelta::FromMicroseconds(0)) {
- GetTaskRunner()->PostDelayedTask(posted_from_,
- base::Bind(&BaseTimerTaskInternal::Run, base::Owned(scheduled_task_)),
+ GetTaskRunner()->PostDelayedTask(
+ posted_from_,
+ base::BindOnce(&BaseTimerTaskInternal::Run,
+ base::Owned(scheduled_task_)),
delay);
scheduled_run_time_ = desired_run_time_ = Now() + delay;
} else {
GetTaskRunner()->PostTask(posted_from_,
- base::Bind(&BaseTimerTaskInternal::Run, base::Owned(scheduled_task_)));
+ base::BindOnce(&BaseTimerTaskInternal::Run,
+ base::Owned(scheduled_task_)));
scheduled_run_time_ = desired_run_time_ = TimeTicks();
}
// Remember the thread ID that posts the first task -- this will be verified
« no previous file with comments | « base/threading/worker_pool_unittest.cc ('k') | base/trace_event/memory_dump_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698