Jesse McKenna | b85e25b | 2018-11-27 21:37:02 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors. All rights reserved. |
| 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_UPDATEABLE_SEQUENCED_TASK_RUNNER_H_ |
| 6 | #define BASE_UPDATEABLE_SEQUENCED_TASK_RUNNER_H_ |
| 7 | |
| 8 | #include "base/sequenced_task_runner.h" |
| 9 | #include "base/task/task_traits.h" |
| 10 | |
| 11 | namespace base { |
| 12 | |
| 13 | // A SequencedTaskRunner whose posted tasks' priorities can be updated. |
| 14 | class BASE_EXPORT UpdateableSequencedTaskRunner : public SequencedTaskRunner { |
| 15 | public: |
David Bienvenu | 5f4d4f0 | 2020-09-27 16:55:03 | [diff] [blame^] | 16 | UpdateableSequencedTaskRunner(const UpdateableSequencedTaskRunner&) = delete; |
| 17 | UpdateableSequencedTaskRunner& operator=( |
| 18 | const UpdateableSequencedTaskRunner&) = delete; |
Jesse McKenna | b85e25b | 2018-11-27 21:37:02 | [diff] [blame] | 19 | // Updates the priority for tasks posted through this TaskRunner to |
| 20 | // |priority|. |
| 21 | virtual void UpdatePriority(TaskPriority priority) = 0; |
| 22 | |
| 23 | protected: |
| 24 | UpdateableSequencedTaskRunner() = default; |
| 25 | ~UpdateableSequencedTaskRunner() override = default; |
Jesse McKenna | b85e25b | 2018-11-27 21:37:02 | [diff] [blame] | 26 | }; |
| 27 | |
| 28 | } // namespace base |
| 29 | |
| 30 | #endif // BASE_UPDATEABLE_SEQUENCED_TASK_RUNNER_H_ |