updateable_sequenced_task_runner.h 1.0 KB

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