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

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

Issue 2122543002: Replace Closure in TaskRunner::PostTask with OneShotCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@07_oneshot
Patch Set: fix Created 4 years, 3 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", 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
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
OLDNEW
« no previous file with comments | « components/memory_pressure/memory_pressure_monitor_unittest.cc ('k') | components/user_manager/fake_user_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698