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 #include "base/task_scheduler/post_task.h" | |
6 | |
7 #include "base/logging.h" | |
8 #include "base/task_scheduler/task_scheduler.h" | |
9 | |
10 namespace base { | |
11 | |
12 void PostTask(const tracked_objects::Location& from_here, const Closure& task) { | |
13 PostTaskWithTraits(from_here, TaskTraits(), task); | |
14 } | |
15 | |
16 void PostTaskAndReply(const tracked_objects::Location& from_here, | |
17 const Closure& task, | |
18 const Closure& reply) { | |
19 PostTaskWithTraitsAndReply(from_here, TaskTraits(), task, reply); | |
20 } | |
21 | |
22 void PostTaskWithTraits(const tracked_objects::Location& from_here, | |
23 TaskTraits traits, | |
24 const Closure& task) { | |
25 DCHECK(TaskScheduler::GetInstance()); | |
robliao
2016/02/11 22:49:30
Remove DCHECK and the one in CreateTaskRunnerWithT
fdoray
2016/02/12 04:16:19
Done.
| |
26 TaskScheduler::GetInstance()->PostTaskWithTraits(from_here, traits, task); | |
27 } | |
28 | |
29 void PostTaskWithTraitsAndReply(const tracked_objects::Location& from_here, | |
30 TaskTraits traits, | |
31 const Closure& task, | |
32 const Closure& reply) { | |
33 // TODO: Post and reply wrapper. | |
34 NOTIMPLEMENTED(); | |
35 } | |
36 | |
37 scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits( | |
38 TaskTraits traits, | |
39 ExecutionMode execution_mode) { | |
40 DCHECK(TaskScheduler::GetInstance()); | |
41 return TaskScheduler::GetInstance()->CreateTaskRunnerWithTraits( | |
42 traits, execution_mode); | |
43 } | |
44 | |
45 } // namespace base | |
OLD | NEW |