xref: /aosp_15_r20/external/cronet/base/task/updateable_sequenced_task_runner.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2018 The Chromium Authors
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_UPDATEABLE_SEQUENCED_TASK_RUNNER_H_
6 #define BASE_TASK_UPDATEABLE_SEQUENCED_TASK_RUNNER_H_
7 
8 #include "base/base_export.h"
9 #include "base/task/sequenced_task_runner.h"
10 #include "base/task/task_traits.h"
11 
12 namespace base {
13 
14 // A SequencedTaskRunner whose posted tasks' priorities can be updated.
15 class BASE_EXPORT UpdateableSequencedTaskRunner : public SequencedTaskRunner {
16  public:
17   UpdateableSequencedTaskRunner(const UpdateableSequencedTaskRunner&) = delete;
18   UpdateableSequencedTaskRunner& operator=(
19       const UpdateableSequencedTaskRunner&) = delete;
20   // 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;
27 };
28 
29 }  // namespace base
30 
31 #endif  // BASE_TASK_UPDATEABLE_SEQUENCED_TASK_RUNNER_H_
32