Avi Drissman | e4622aa | 2022-09-08 20:36:06 | [diff] [blame] | 1 | // Copyright 2021 The Chromium Authors |
Patrick Monette | 88efc17 | 2021-10-29 16:17:36 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef BASE_TASK_DELAYED_TASK_HANDLE_H_ |
| 6 | #define BASE_TASK_DELAYED_TASK_HANDLE_H_ |
| 7 | |
Patrick Monette | f9eba9a | 2021-12-08 00:55:07 | [diff] [blame] | 8 | #include <memory> |
| 9 | |
Patrick Monette | 88efc17 | 2021-10-29 16:17:36 | [diff] [blame] | 10 | #include "base/base_export.h" |
Patrick Monette | 88efc17 | 2021-10-29 16:17:36 | [diff] [blame] | 11 | |
| 12 | namespace base { |
| 13 | |
| 14 | // A handle to a delayed task which can be used to cancel the posted task. Not |
| 15 | // thread-safe, can only be held and invoked from the posting sequence. |
| 16 | class BASE_EXPORT DelayedTaskHandle { |
| 17 | public: |
| 18 | // The delegate that allows each SequencedTaskRunners to have different |
| 19 | // implementations. |
Patrick Monette | f9eba9a | 2021-12-08 00:55:07 | [diff] [blame] | 20 | class Delegate { |
Patrick Monette | 88efc17 | 2021-10-29 16:17:36 | [diff] [blame] | 21 | public: |
Patrick Monette | f9eba9a | 2021-12-08 00:55:07 | [diff] [blame] | 22 | virtual ~Delegate() = default; |
| 23 | |
Thiabaud Engelbrecht | 34dc2fd | 2024-01-05 21:21:39 | [
|