OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/timer/timer.h" | 5 #include "base/timer/timer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
12 #include "base/thread_task_runner_handle.h" | |
13 #include "base/threading/platform_thread.h" | 12 #include "base/threading/platform_thread.h" |
| 13 #include "base/threading/thread_task_runner_handle.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 | 16 |
17 // BaseTimerTaskInternal is a simple delegate for scheduling a callback to | 17 // BaseTimerTaskInternal is a simple delegate for scheduling a callback to |
18 // Timer in the thread's default task runner. It also handles the following | 18 // Timer in the thread's default task runner. It also handles the following |
19 // edge cases: | 19 // edge cases: |
20 // - deleted by the task runner. | 20 // - deleted by the task runner. |
21 // - abandoned (orphaned) by Timer. | 21 // - abandoned (orphaned) by Timer. |
22 class BaseTimerTaskInternal { | 22 class BaseTimerTaskInternal { |
23 public: | 23 public: |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 PostNewScheduledTask(delay_); | 209 PostNewScheduledTask(delay_); |
210 else | 210 else |
211 Stop(); | 211 Stop(); |
212 | 212 |
213 task.Run(); | 213 task.Run(); |
214 | 214 |
215 // No more member accesses here: *this could be deleted at this point. | 215 // No more member accesses here: *this could be deleted at this point. |
216 } | 216 } |
217 | 217 |
218 } // namespace base | 218 } // namespace base |
OLD | NEW |