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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: base/task_scheduler/post_task.cc
diff --git a/base/task_scheduler/post_task.cc b/base/task_scheduler/post_task.cc
new file mode 100644
index 0000000000000000000000000000000000000000..38f528c8e5bf19bad4494d2892ee122c566a72c9
--- /dev/null
+++ b/base/task_scheduler/post_task.cc
@@ -0,0 +1,45 @@
+// 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.
+
+#include "base/task_scheduler/post_task.h"
+
+#include "base/logging.h"
+#include "base/task_scheduler/task_scheduler.h"
+
+namespace base {
+
+void PostTask(const tracked_objects::Location& from_here, const Closure& task) {
+ PostTaskWithTraits(from_here, TaskTraits(), task);
+}
+
+void PostTaskAndReply(const tracked_objects::Location& from_here,
+ const Closure& task,
+ const Closure& reply) {
+ PostTaskWithTraitsAndReply(from_here, TaskTraits(), task, reply);
+}
+
+void PostTaskWithTraits(const tracked_objects::Location& from_here,
+ TaskTraits traits,
+ const Closure& task) {
+ 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.
+ TaskScheduler::GetInstance()->PostTaskWithTraits(from_here, traits, task);
+}
+
+void PostTaskWithTraitsAndReply(const tracked_objects::Location& from_here,
+ TaskTraits traits,
+ const Closure& task,
+ const Closure& reply) {
+ // TODO: Post and reply wrapper.
+ NOTIMPLEMENTED();
+}
+
+scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits(
+ TaskTraits traits,
+ ExecutionMode execution_mode) {
+ DCHECK(TaskScheduler::GetInstance());
+ return TaskScheduler::GetInstance()->CreateTaskRunnerWithTraits(
+ traits, execution_mode);
+}
+
+} // namespace base

Powered by Google App Engine
This is Rietveld 408576698