blob: a281eb83b16ea3f8fb476e9e1e6553f7048cd8b6 [file] [log] [blame]
Avi Drissmane4622aa2022-09-08 20:36:061// Copyright 2018 The Chromium Authors
Jesse McKennab85e25b2018-11-27 21:37:022// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Patrick Monette39810e72021-10-14 18:06:595#ifndef BASE_TASK_UPDATEABLE_SEQUENCED_TASK_RUNNER_H_
6#define BASE_TASK_UPDATEABLE_SEQUENCED_TASK_RUNNER_H_
Jesse McKennab85e25b2018-11-27 21:37:027
David Sanders6e709942022-04-05 06:49:268#include "base/base_export.h"
Patrick Monette643cdf62021-10-15 19:13:429#include "base/task/sequenced_task_runner.h"
Jesse McKennab85e25b2018-11-27 21:37:0210#include "base/task/task_traits.h"
11
12namespace base {
13
14// A SequencedTaskRunner whose posted tasks' priorities can be updated.
15class BASE_EXPORT UpdateableSequencedTaskRunner : public SequencedTaskRunner {
16 public:
David Bienvenu5f4d4f02020-09-27 16:55:0317 UpdateableSequencedTaskRunner(const UpdateableSequencedTaskRunner&) = delete;
18 UpdateableSequencedTaskRunner& operator=(
19 const UpdateableSequencedTaskRunner&) = delete;
Jesse McKennab85e25b2018-11-27 21:37:0220 // Updates the priority for tasks posted through this TaskRunner to
21 // |priority|.
22 virtual void UpdatePriority(TaskPriority priority) = 0;
23
24 protected:
25 UpdateableSequencedTaskRunner() = default;
26 ~UpdateableSequencedTaskRunner() override = default;
Jesse McKennab85e25b2018-11-27 21:37:0227};
28
29} // namespace base
30
Patrick Monette39810e72021-10-14 18:06:5931#endif // BASE_TASK_UPDATEABLE_SEQUENCED_TASK_RUNNER_H_