Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: base/task_scheduler/utils.h

Issue 1708773002: TaskScheduler [7] SchedulerThreadPool (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@s_5_worker_thread
Patch Set: fix windows build error Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/task_scheduler/task_traits.cc ('k') | base/task_scheduler/utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 // Attempts to post a task to the provided |sequence| and |executor| conditional
29 // on |task_tracker|. Returns true if the task is posted.
30 bool BASE_EXPORT
31 PostTaskToExecutor(const tracked_objects::Location& posted_from,
32 const Closure& closure,
33 const TaskTraits& traits,
34 const TimeDelta& delay,
35 scoped_refptr<Sequence> sequence,
36 SchedulerTaskExecutor* executor,
37 TaskTracker* task_tracker);
38
39 // Posts |task| to the provided |sequence| and |priority_queue|. This must only
40 // be called after |task|'s delayed run time. Returns true if |sequence| was
41 // empty before |task| was inserted into it.
42 bool BASE_EXPORT
43 AddTaskToSequenceAndPriorityQueue(std::unique_ptr<Task> task,
44 scoped_refptr<Sequence> sequence,
45 PriorityQueue* priority_queue);
46
47 } // namespace internal
48 } // namespace base
49
50 #endif // BASE_TASK_SCHEDULER_UTILS_H_
OLDNEW
« no previous file with comments | « base/task_scheduler/task_traits.cc ('k') | base/task_scheduler/utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698