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

Unified Diff: base/task_scheduler/utils.h

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/utils.h
diff --git a/base/task_scheduler/utils.h b/base/task_scheduler/utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..54725f93853a3c260eaea3bed62808f273ffa5d7
--- /dev/null
+++ b/base/task_scheduler/utils.h
@@ -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.
+
+#ifndef BASE_TASK_SCHEDULER_UTILS_H_
+#define BASE_TASK_SCHEDULER_UTILS_H_
+
+#include "base/base_export.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/task_scheduler/sequence.h"
+#include "base/task_scheduler/task.h"
+
+namespace base {
+namespace task_scheduler {
+
+class DelayedTaskManager;
+class PriorityQueue;
+class ShutdownManager;
+
+// Name used to annotate tasks posted to the task scheduler.
+// See task_annotator.h for more details.
+extern const char kQueueFunctionName[];
+
+// Adds |task| to |delayed_task_manager| if it has a delayed run time.
+// Otherwise, calls PostTaskNowHelper().
+void BASE_EXPORT PostTaskHelper(const Task& task,
+ scoped_refptr<Sequence> sequence,
+ PriorityQueue* priority_queue,
+ ShutdownManager* shutdown_manager,
+ DelayedTaskManager* delayed_task_manager);
+
+// Inserts |task| into |sequence|. Then, inserts |sequence| into
+// |priority_queue| if it was empty before |task| was inserted into it.
+// |shutdown_manager| is consulted to determine whether it is too late to post
+// the task.
+void BASE_EXPORT PostTaskNowHelper(const Task& task,
+ scoped_refptr<Sequence> sequence,
+ PriorityQueue* priority_queue,
+ ShutdownManager* shutdown_manager);
+
+} // namespace task_scheduler
+} // namespace base
+
+#endif // BASE_TASK_SCHEDULER_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698