Chromium Code Reviews| 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 427 // Take ownership of the pending user task, which is going to be cleared by | 427 // Take ownership of the pending user task, which is going to be cleared by |
| 428 // the Stop() or Reset() functions below. | 428 // the Stop() or Reset() functions below. |
| 429 scoped_ptr<base::PendingTask> pending_user_task(std::move(pending_task_)); | 429 scoped_ptr<base::PendingTask> pending_user_task(std::move(pending_task_)); |
| 430 | 430 |
| 431 // Re-schedule or stop the timer as requested. | 431 // Re-schedule or stop the timer as requested. |
| 432 if (base::Timer::is_repeating()) | 432 if (base::Timer::is_repeating()) |
| 433 Reset(); | 433 Reset(); |
| 434 else | 434 else |
| 435 Stop(); | 435 Stop(); |
| 436 | 436 |
| 437 TRACE_TASK_EXECUTION("AlarmTimer::OnTimerFired", *pending_user_task); | 437 TRACE_TASK_EXECUTION("AlarmTimer::OnTimerFired", (*pending_user_task)); |
|
Primiano Tucci (use gerrit)
2016/03/31 15:37:16
why do we need parentheses here? smells like we ne
Nico
2016/03/31 16:12:48
yup, +1
ssid
2016/04/01 04:34:54
yes, I was thinking it is better to add here inste
| |
| 438 | 438 |
| 439 // Now run the user task. | 439 // Now run the user task. |
| 440 base::MessageLoop::current()->task_annotator()->RunTask("AlarmTimer::Reset", | 440 base::MessageLoop::current()->task_annotator()->RunTask("AlarmTimer::Reset", |
| 441 *pending_user_task); | 441 *pending_user_task); |
| 442 } | 442 } |
| 443 | 443 |
| 444 OneShotAlarmTimer::OneShotAlarmTimer() : AlarmTimer(false, false) { | 444 OneShotAlarmTimer::OneShotAlarmTimer() : AlarmTimer(false, false) { |
| 445 } | 445 } |
| 446 | 446 |
| 447 OneShotAlarmTimer::~OneShotAlarmTimer() { | 447 OneShotAlarmTimer::~OneShotAlarmTimer() { |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 466 SimpleAlarmTimer::SimpleAlarmTimer(const tracked_objects::Location& posted_from, | 466 SimpleAlarmTimer::SimpleAlarmTimer(const tracked_objects::Location& posted_from, |
| 467 base::TimeDelta delay, | 467 base::TimeDelta delay, |
| 468 const base::Closure& user_task) | 468 const base::Closure& user_task) |
| 469 : AlarmTimer(posted_from, delay, user_task, false) { | 469 : AlarmTimer(posted_from, delay, user_task, false) { |
| 470 } | 470 } |
| 471 | 471 |
| 472 SimpleAlarmTimer::~SimpleAlarmTimer() { | 472 SimpleAlarmTimer::~SimpleAlarmTimer() { |
| 473 } | 473 } |
| 474 | 474 |
| 475 } // namespace timers | 475 } // namespace timers |
| OLD | NEW |