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

Unified Diff: base/task_scheduler/scheduler_task_executor.h

Issue 1708773002: TaskScheduler [7] SchedulerThreadPool (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@s_5_worker_thread
Patch Set: Wake up a thread explicitly when a Sequence is added in a PQ. 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 side-by-side diff with in-line comments
Download patch
Index: base/task_scheduler/scheduler_task_executor.h
diff --git a/base/task_scheduler/scheduler_task_executor.h b/base/task_scheduler/scheduler_task_executor.h
new file mode 100644
index 0000000000000000000000000000000000000000..2179e2e7e003de23d70a64a97e8ded7cbaf531db
--- /dev/null
+++ b/base/task_scheduler/scheduler_task_executor.h
@@ -0,0 +1,32 @@
+// 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_SCHEDULER_TASK_EXECUTOR_H_
+#define BASE_TASK_SCHEDULER_SCHEDULER_TASK_EXECUTOR_H_
+
+#include <memory>
+
+#include "base/memory/ref_counted.h"
+#include "base/task_scheduler/sequence.h"
+#include "base/task_scheduler/task.h"
+
+namespace base {
+namespace internal {
+
+// Interface for a component that runs Tasks.
+class SchedulerTaskExecutor {
+ public:
+ virtual ~SchedulerTaskExecutor() = default;
+
+ // Posts |task| to be executed by this component as part of |sequence|. The
+ // delayed run time of |task| is ignored. The scheduler's TaskTracker must
robliao 2016/04/13 20:50:54 Ignoring the delayed run time is an implementation
fdoray 2016/04/13 23:13:12 Done.
+ // have allowed |task| to be posted before this is called.
+ virtual void PostTaskNow(std::unique_ptr<Task> task,
+ scoped_refptr<Sequence> sequence) = 0;
+};
+
+} // namespace internal
+} // namespace base
+
+#endif // BASE_TASK_SCHEDULER_SCHEDULER_TASK_EXECUTOR_H_

Powered by Google App Engine
This is Rietveld 408576698