Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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_TASK_SCHEDULER_UTILS_H_ | |
| 6 #define BASE_TASK_SCHEDULER_UTILS_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/base_export.h" | |
| 11 #include "base/callback_forward.h" | |
| 12 #include "base/location.h" | |
| 13 #include "base/memory/ref_counted.h" | |
| 14 #include "base/task_scheduler/sequence.h" | |
| 15 #include "base/task_scheduler/task.h" | |
| 16 | |
| 17 namespace base { | |
| 18 | |
| 19 class TaskTraits; | |
| 20 class TimeDelta; | |
| 21 | |
| 22 namespace internal { | |
| 23 | |
| 24 class PriorityQueue; | |
| 25 class SchedulerTaskExecutor; | |
| 26 class TaskTracker; | |
| 27 | |
| 28 // Helper for posting a task to the provided |sequence| and |executor| | |
|
danakj
2016/04/14 19:48:58
"Helper for posting" -> "Attempts to post"
fdoray
2016/04/14 23:46:58
Done.
| |
| 29 // conditional on |task_tracker|. Returns true if the task is posted. | |
| 30 bool BASE_EXPORT PostTaskHelper(const tracked_objects::Location& posted_from, | |
|
danakj
2016/04/14 19:48:58
Can you name this more descriptively based on what
fdoray
2016/04/14 23:46:58
Done. Renamed it PostTaskToExecutor.
| |
| 31 const Closure& closure, | |
| 32 const TaskTraits& traits, | |
| 33 const TimeDelta& delay, | |
| 34 scoped_refptr<Sequence> sequence, | |
| 35 SchedulerTaskExecutor* executor, | |
| 36 TaskTracker* task_tracker); | |
| 37 | |
| 38 // Helper for posting |task| to the provided |sequence| and |priority_queue|. | |
|
danakj
2016/04/14 19:48:58
ditto
fdoray
2016/04/14 23:46:58
Done.
| |
| 39 // Returns true if |sequence| was empty before |task| was inserted into it. | |
| 40 bool BASE_EXPORT PostTaskNowHelper(std::unique_ptr<Task> task, | |
|
danakj
2016/04/14 19:48:58
Ditto, "Helper" is not helpful in telling me what
fdoray
2016/04/14 23:46:58
Done.
| |
| 41 scoped_refptr<Sequence> sequence, | |
| 42 PriorityQueue* priority_queue); | |
| 43 | |
| 44 } // namespace internal | |
| 45 } // namespace base | |
| 46 | |
| 47 #endif // BASE_TASK_SCHEDULER_UTILS_H_ | |
| OLD | NEW |