Chromium Code Reviews| 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(); |