Chromium Code Reviews| Index: base/task_scheduler/utils.h |
| diff --git a/base/task_scheduler/utils.h b/base/task_scheduler/utils.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ab7aaf00013f57c039791d683b440e2b04e65928 |
| --- /dev/null |
| +++ b/base/task_scheduler/utils.h |
| @@ -0,0 +1,31 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BASE_TASK_SCHEDULER_UTILS_H_ |
| +#define BASE_TASK_SCHEDULER_UTILS_H_ |
| + |
| +#include <memory> |
| + |
| +#include "base/base_export.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "base/task_scheduler/sequence.h" |
| +#include "base/task_scheduler/task.h" |
| + |
| +namespace base { |
| +namespace internal { |
| + |
| +class PriorityQueue; |
| +class TaskTracker; |
| + |
| +// Helper for posting |task| to the provided |sequence| and |priority_queue| |
| +// conditional on |task_tracker|. Returns true if |task| is posted. |
| +bool BASE_EXPORT PostTaskHelper(std::unique_ptr<Task> task, |
|
gab
2016/04/08 17:56:00
This method could be private on SchedulerThreadPoo
danakj
2016/04/08 18:05:32
That, or protected with a TestSTP that makes it pu
fdoray
2016/04/08 19:00:05
I don't think that this helper should be in STP. I
|
| + scoped_refptr<Sequence> sequence, |
| + PriorityQueue* priority_queue, |
| + TaskTracker* task_tracker); |
| + |
| +} // namespace internal |
| +} // namespace base |
| + |
| +#endif // BASE_TASK_SCHEDULER_UTILS_H_ |