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

Side by Side Diff: base/task_scheduler/post_task.cc

Issue 1685423002: Task Scheduler. (Closed) Base URL: https://luckyluke-private.googlesource.com/src@a_master
Patch Set: Created 4 years, 10 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
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 #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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698