| OLD | NEW |
| 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 Loading... |
| 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", pending_user_task.get()); |
| 443 } | 443 } |
| 444 | 444 |
| 445 OneShotAlarmTimer::OneShotAlarmTimer() : AlarmTimer(false, false) { | 445 OneShotAlarmTimer::OneShotAlarmTimer() : AlarmTimer(false, false) { |
| 446 } | 446 } |
| 447 | 447 |
| 448 OneShotAlarmTimer::~OneShotAlarmTimer() { | 448 OneShotAlarmTimer::~OneShotAlarmTimer() { |
| 449 } | 449 } |
| 450 | 450 |
| 451 RepeatingAlarmTimer::RepeatingAlarmTimer() : AlarmTimer(true, true) { | 451 RepeatingAlarmTimer::RepeatingAlarmTimer() : AlarmTimer(true, true) { |
| 452 } | 452 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 467 SimpleAlarmTimer::SimpleAlarmTimer(const tracked_objects::Location& posted_from, | 467 SimpleAlarmTimer::SimpleAlarmTimer(const tracked_objects::Location& posted_from, |
| 468 base::TimeDelta delay, | 468 base::TimeDelta delay, |
| 469 const base::Closure& user_task) | 469 const base::Closure& user_task) |
| 470 : AlarmTimer(posted_from, delay, user_task, false) { | 470 : AlarmTimer(posted_from, delay, user_task, false) { |
| 471 } | 471 } |
| 472 | 472 |
| 473 SimpleAlarmTimer::~SimpleAlarmTimer() { | 473 SimpleAlarmTimer::~SimpleAlarmTimer() { |
| 474 } | 474 } |
| 475 | 475 |
| 476 } // namespace timers | 476 } // namespace timers |
| OLD | NEW |