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

Unified Diff: base/task_scheduler/scheduler_worker_thread.h

Issue 1876363004: TaskScheduler [11] Support ExecutionMode::SINGLE_THREADED. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@8_delayed
Patch Set: always define ContainsWorkerThread, remove unused include 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_worker_thread.h
diff --git a/base/task_scheduler/scheduler_worker_thread.h b/base/task_scheduler/scheduler_worker_thread.h
index 3022d100c61239b863c51d95b64e0252ef1360f1..5de245dcb019a3846b52e57368df2c29e84bd7da 100644
--- a/base/task_scheduler/scheduler_worker_thread.h
+++ b/base/task_scheduler/scheduler_worker_thread.h
@@ -37,8 +37,8 @@ class BASE_EXPORT SchedulerWorkerThread : public PlatformThread::Delegate {
public:
virtual ~Delegate() = default;
- // Called when the main function of the SchedulerWorkerThread enters.
- virtual void OnMainEntry() = 0;
+ // Called by |worker_thread| when it enters its main function.
+ virtual void OnMainEntry(SchedulerWorkerThread* worker_thread) = 0;
// Called by |worker_thread| to get a Sequence from which to run a Task.
virtual scoped_refptr<Sequence> GetWork(
@@ -68,6 +68,8 @@ class BASE_EXPORT SchedulerWorkerThread : public PlatformThread::Delegate {
// returned by the GetWork() method of its delegate until it returns nullptr.
void WakeUp();
+ SchedulerWorkerThread::Delegate* delegate() { return delegate_.get(); }
danakj 2016/04/27 20:38:13 I also wonder about exposing the delegate here, th
gab 2016/04/27 20:45:39 I asked for this. Asking the SchedulerWorkerThread
danakj 2016/04/27 20:53:28 What if Delegate had a GetThreadPriorityQueue?
robliao 2016/04/27 21:14:53 We would like the SchedulerWorkerThread to be agno
danakj 2016/04/27 21:56:38 OK that is fair yeah. We do the same thing when we
+
// Joins this SchedulerWorkerThread. If a Task is already running, it will be
// allowed to complete its execution. This can only be called once.
void JoinForTesting();

Powered by Google App Engine
This is Rietveld 408576698