updateable_sequenced_task_runner.h 1.1 KB

12345678910111213141516171819202122232425262728293031
  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. #ifndef BASE_TASK_UPDATEABLE_SEQUENCED_TASK_RUNNER_H_
  5. #define BASE_TASK_UPDATEABLE_SEQUENCED_TASK_RUNNER_H_
  6. #include "base/base_export.h"
  7. #include "base/task/sequenced_task_runner.h"
  8. #include "base/task/task_traits.h"
  9. namespace base {
  10. // A SequencedTaskRunner whose posted tasks' priorities can be updated.
  11. class BASE_EXPORT UpdateableSequencedTaskRunner : public SequencedTaskRunner {
  12. public:
  13. UpdateableSequencedTaskRunner(const UpdateableSequencedTaskRunner&) = delete;
  14. UpdateableSequencedTaskRunner& operator=(
  15. const UpdateableSequencedTaskRunner&) = delete;
  16. // Updates the priority for tasks posted through this TaskRunner to
  17. // |priority|.
  18. virtual void UpdatePriority(TaskPriority priority) = 0;
  19. protected:
  20. UpdateableSequencedTaskRunner() = default;
  21. ~UpdateableSequencedTaskRunner() override = default;
  22. };
  23. } // namespace base
  24. #endif // BASE_TASK_UPDATEABLE_SEQUENCED_TASK_RUNNER_H_