blob: 513832bb5dcd348ac990ec102f70c4ab7706c0d1 [file] [log] [blame]
Avi Drissmane4622aa2022-09-08 20:36:061// Copyright 2021 The Chromium Authors
Patrick Monette88efc172021-10-29 16:17:362// 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 Monettef9eba9a2021-12-08 00:55:078#include <memory>
9
Patrick Monette88efc172021-10-29 16:17:3610#include "base/base_export.h"
Patrick Monette88efc172021-10-29 16:17:3611
12namespace 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.
16class BASE_EXPORT DelayedTaskHandle {
17 public:
18 // The delegate that allows each SequencedTaskRunners to have different
19 // implementations.
Patrick Monettef9eba9a2021-12-08 00:55:0720 class Delegate {
Patrick Monette88efc172021-10-29 16:17:3621 public:
Patrick Monettef9eba9a2021-12-08 00:55:0722 virtual ~Delegate() = default;
23
Thiabaud Engelbrecht34dc2fd2024-01-05 21:21:39