| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_ | 5 #ifndef BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_ |
| 6 #define BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_ | 6 #define BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // SchedulerThreadPool. | 38 // SchedulerThreadPool. |
| 39 virtual void ReEnqueueSequence(scoped_refptr<Sequence> sequence, | 39 virtual void ReEnqueueSequence(scoped_refptr<Sequence> sequence, |
| 40 const SequenceSortKey& sequence_sort_key) = 0; | 40 const SequenceSortKey& sequence_sort_key) = 0; |
| 41 | 41 |
| 42 // Posts |task| to be executed by this SchedulerThreadPool as part of | 42 // Posts |task| to be executed by this SchedulerThreadPool as part of |
| 43 // |sequence|. If |worker_thread| is non-null, |task| will be scheduled to run | 43 // |sequence|. If |worker_thread| is non-null, |task| will be scheduled to run |
| 44 // on it specifically (note: |worker_thread| must be owned by this | 44 // on it specifically (note: |worker_thread| must be owned by this |
| 45 // SchedulerThreadPool); otherwise, |task| will be added to the pending shared | 45 // SchedulerThreadPool); otherwise, |task| will be added to the pending shared |
| 46 // work. |task| won't be executed before its delayed run time, if any. Returns | 46 // work. |task| won't be executed before its delayed run time, if any. Returns |
| 47 // true if |task| is posted. | 47 // true if |task| is posted. |
| 48 //FIXME: Remove from public interface? |
| 48 virtual bool PostTaskWithSequence(std::unique_ptr<Task> task, | 49 virtual bool PostTaskWithSequence(std::unique_ptr<Task> task, |
| 49 scoped_refptr<Sequence> sequence, | 50 scoped_refptr<Sequence> sequence, |
| 50 SchedulerWorkerThread* worker_thread) = 0; | 51 SchedulerWorkerThread* worker_thread) = 0; |
| 51 | 52 |
| 52 // Posts |task| to be executed by this SchedulerThreadPool as part of | 53 // Posts |task| to be executed by this SchedulerThreadPool as part of |
| 53 // |sequence|. If |worker_thread| is non-null, |task| will be scheduled to run | 54 // |sequence|. If |worker_thread| is non-null, |task| will be scheduled to run |
| 54 // on it specifically (note: |worker_thread| must be owned by this | 55 // on it specifically (note: |worker_thread| must be owned by this |
| 55 // SchedulerThreadPool); otherwise, |task| will be added to the pending shared | 56 // SchedulerThreadPool); otherwise, |task| will be added to the pending shared |
| 56 // work. This must only be called after |task| has gone through | 57 // work. This must only be called after |task| has gone through |
| 57 // PostTaskWithSequence() and after |task|'s delayed run time. | 58 // PostTaskWithSequence() and after |task|'s delayed run time. |
| 58 virtual void PostTaskWithSequenceNow( | 59 virtual void PostTaskWithSequenceNow( |
| 59 std::unique_ptr<Task> task, | 60 std::unique_ptr<Task> task, |
| 60 scoped_refptr<Sequence> sequence, | 61 scoped_refptr<Sequence> sequence, |
| 61 SchedulerWorkerThread* worker_thread) = 0; | 62 SchedulerWorkerThread* worker_thread) = 0; |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 } // namespace internal | 65 } // namespace internal |
| 65 } // namespace base | 66 } // namespace base |
| 66 | 67 |
| 67 #endif // BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_ | 68 #endif // BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_ |
| OLD | NEW |