updateable_sequenced_task_runner.h 915 B

1234567891011121314151617181920212223242526272829
  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. // Updates the priority for tasks posted through this TaskRunner to
  13. // |priority|.
  14. virtual void UpdatePriority(TaskPriority priority) = 0;
  15. protected:
  16. UpdateableSequencedTaskRunner() = default;
  17. ~UpdateableSequencedTaskRunner() override = default;
  18. DISALLOW_COPY_AND_ASSIGN(UpdateableSequencedTaskRunner);
  19. };
  20. } // namespace base
  21. #endif // BASE_UPDATEABLE_SEQUENCED_TASK_RUNNER_H_