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

Side by Side Diff: components/timers/alarm_timer_chromeos.cc

Issue 2386653002: Replace base::Callback with base::OnceCallback in base::PendingTask (Closed)
Patch Set: revert most of task_scheduler changes Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/timers/alarm_timer_chromeos.h" 5 #include "components/timers/alarm_timer_chromeos.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <sys/timerfd.h> 8 #include <sys/timerfd.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 431
432 // Re-schedule or stop the timer as requested. 432 // Re-schedule or stop the timer as requested.
433 if (base::Timer::is_repeating()) 433 if (base::Timer::is_repeating())
434 Reset(); 434 Reset();
435 else 435 else
436 Stop(); 436 Stop();
437 437
438 TRACE_TASK_EXECUTION("AlarmTimer::OnTimerFired", *pending_user_task); 438 TRACE_TASK_EXECUTION("AlarmTimer::OnTimerFired", *pending_user_task);
439 439
440 // Now run the user task. 440 // Now run the user task.
441 base::MessageLoop::current()->task_annotator()->RunTask("AlarmTimer::Reset", 441 base::MessageLoop::current()->task_annotator()->RunTask(
442 *pending_user_task); 442 "AlarmTimer::Reset",
443 pending_user_task.get());
443 } 444 }
444 445
445 OneShotAlarmTimer::OneShotAlarmTimer() : AlarmTimer(false, false) { 446 OneShotAlarmTimer::OneShotAlarmTimer() : AlarmTimer(false, false) {
446 } 447 }
447 448
448 OneShotAlarmTimer::~OneShotAlarmTimer() { 449 OneShotAlarmTimer::~OneShotAlarmTimer() {
449 } 450 }
450 451
451 RepeatingAlarmTimer::RepeatingAlarmTimer() : AlarmTimer(true, true) { 452 RepeatingAlarmTimer::RepeatingAlarmTimer() : AlarmTimer(true, true) {
452 } 453 }
(...skipping 14 matching lines...) Expand all
467 SimpleAlarmTimer::SimpleAlarmTimer(const tracked_objects::Location& posted_from, 468 SimpleAlarmTimer::SimpleAlarmTimer(const tracked_objects::Location& posted_from,
468 base::TimeDelta delay, 469 base::TimeDelta delay,
469 const base::Closure& user_task) 470 const base::Closure& user_task)
470 : AlarmTimer(posted_from, delay, user_task, false) { 471 : AlarmTimer(posted_from, delay, user_task, false) {
471 } 472 }
472 473
473 SimpleAlarmTimer::~SimpleAlarmTimer() { 474 SimpleAlarmTimer::~SimpleAlarmTimer() {
474 } 475 }
475 476
476 } // namespace timers 477 } // namespace timers
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698