| 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> |
| 8 |
| 7 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ref_counted.h" |
| 8 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| 9 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
| 10 #include "base/threading/platform_thread.h" | 13 #include "base/threading/platform_thread.h" |
| 11 | 14 |
| 12 namespace base { | 15 namespace base { |
| 13 | 16 |
| 14 // BaseTimerTaskInternal is a simple delegate for scheduling a callback to | 17 // BaseTimerTaskInternal is a simple delegate for scheduling a callback to |
| 15 // 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 |
| 16 // edge cases: | 19 // edge cases: |
| 17 // - deleted by the task runner. | 20 // - deleted by the task runner. |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 PostNewScheduledTask(delay_); | 180 PostNewScheduledTask(delay_); |
| 178 else | 181 else |
| 179 Stop(); | 182 Stop(); |
| 180 | 183 |
| 181 task.Run(); | 184 task.Run(); |
| 182 | 185 |
| 183 // No more member accesses here: *this could be deleted at this point. | 186 // No more member accesses here: *this could be deleted at this point. |
| 184 } | 187 } |
| 185 | 188 |
| 186 } // namespace base | 189 } // namespace base |
| OLD | NEW |