| 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 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 13 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
| 14 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
| 18 #include "base/pending_task.h" | 18 #include "base/pending_task.h" |
| 19 #include "base/thread_task_runner_handle.h" | |
| 20 #include "base/threading/thread.h" | 19 #include "base/threading/thread.h" |
| 20 #include "base/threading/thread_task_runner_handle.h" |
| 21 #include "base/trace_event/trace_event.h" | 21 #include "base/trace_event/trace_event.h" |
| 22 | 22 |
| 23 namespace timers { | 23 namespace timers { |
| 24 namespace { | 24 namespace { |
| 25 // This class represents the IO thread that the AlarmTimer::Delegate may use for | 25 // This class represents the IO thread that the AlarmTimer::Delegate may use for |
| 26 // watching file descriptors if it gets called from a thread that does not have | 26 // watching file descriptors if it gets called from a thread that does not have |
| 27 // a MessageLoopForIO. It is a lazy global instance because it may not always | 27 // a MessageLoopForIO. It is a lazy global instance because it may not always |
| 28 // be necessary. | 28 // be necessary. |
| 29 class RtcAlarmIOThread : public base::Thread { | 29 class RtcAlarmIOThread : public base::Thread { |
| 30 public: | 30 public: |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |