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 #ifndef COMPONENTS_TIMER_ALARM_TIMER_H_ | 5 #ifndef COMPONENTS_TIMER_ALARM_TIMER_H_ |
6 #define COMPONENTS_TIMER_ALARM_TIMER_H_ | 6 #define COMPONENTS_TIMER_ALARM_TIMER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 friend class base::RefCountedThreadSafe<Delegate>; | 52 friend class base::RefCountedThreadSafe<Delegate>; |
53 }; | 53 }; |
54 | 54 |
55 AlarmTimer(bool retain_user_task, bool is_repeating); | 55 AlarmTimer(bool retain_user_task, bool is_repeating); |
56 | 56 |
57 AlarmTimer(const tracked_objects::Location& posted_from, | 57 AlarmTimer(const tracked_objects::Location& posted_from, |
58 base::TimeDelta delay, | 58 base::TimeDelta delay, |
59 const base::Closure& user_task, | 59 const base::Closure& user_task, |
60 bool is_repeating); | 60 bool is_repeating); |
61 | 61 |
62 virtual ~AlarmTimer(); | 62 ~AlarmTimer() override; |
63 | 63 |
64 // Timer overrides. | 64 // Timer overrides. |
65 void Stop() override; | 65 void Stop() override; |
66 void Reset() override; | 66 void Reset() override; |
67 | 67 |
68 // MessageLoop::DestructionObserver overrides. | 68 // MessageLoop::DestructionObserver overrides. |
69 void WillDestroyCurrentMessageLoop() override; | 69 void WillDestroyCurrentMessageLoop() override; |
70 | 70 |
71 // Must be called by the delegate to indicate that the timer has fired and | 71 // Must be called by the delegate to indicate that the timer has fired and |
72 // that the user task should be run. | 72 // that the user task should be run. |
(...skipping 21 matching lines...) Expand all Loading... |
94 base::MessageLoop* origin_message_loop_; | 94 base::MessageLoop* origin_message_loop_; |
95 | 95 |
96 base::WeakPtrFactory<AlarmTimer> weak_factory_; | 96 base::WeakPtrFactory<AlarmTimer> weak_factory_; |
97 | 97 |
98 DISALLOW_COPY_AND_ASSIGN(AlarmTimer); | 98 DISALLOW_COPY_AND_ASSIGN(AlarmTimer); |
99 }; | 99 }; |
100 | 100 |
101 } // namespace timers | 101 } // namespace timers |
102 | 102 |
103 #endif // COMPONENTS_TIMER_ALARM_TIMER_H_ | 103 #endif // COMPONENTS_TIMER_ALARM_TIMER_H_ |
OLD | NEW |