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

Unified Diff: base/task_scheduler/scheduler_worker.h

Issue 2208493002: TaskScheduler: No BACKGROUND threads when unsupported. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + CR robliao #6 (nit) Created 4 years, 4 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
« no previous file with comments | « no previous file | base/task_scheduler/scheduler_worker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/scheduler_worker.h
diff --git a/base/task_scheduler/scheduler_worker.h b/base/task_scheduler/scheduler_worker.h
index 71d4cbcc91667b27be3537c8519aafc802bd4221..d741f9545f4562f0dc4ad9b62f72c9458f3f72c0 100644
--- a/base/task_scheduler/scheduler_worker.h
+++ b/base/task_scheduler/scheduler_worker.h
@@ -77,13 +77,15 @@ class BASE_EXPORT SchedulerWorker {
enum class InitialState { ALIVE, DETACHED };
- // Creates a SchedulerWorker with priority |thread_priority| that runs Tasks
- // from Sequences returned by |delegate|. |task_tracker| is used to handle
- // shutdown behavior of Tasks. If |worker_state| is DETACHED, the thread will
- // be created upon a WakeUp(). Returns nullptr if creating the underlying
- // platform thread fails during Create().
+ // Creates a SchedulerWorker that runs Tasks from Sequences returned by
+ // |delegate|. |priority_hint| is the preferred thread priority; the actual
+ // thread priority depends on shutdown state and platform capabilities.
+ // |task_tracker| is used to handle shutdown behavior of Tasks. If
+ // |worker_state| is DETACHED, the thread will be created upon a WakeUp().
+ // Returns nullptr if creating the underlying platform thread fails during
+ // Create().
static std::unique_ptr<SchedulerWorker> Create(
- ThreadPriority thread_priority,
+ ThreadPriority priority_hint,
std::unique_ptr<Delegate> delegate,
TaskTracker* task_tracker,
InitialState initial_state);
@@ -133,7 +135,7 @@ class BASE_EXPORT SchedulerWorker {
// The underlying thread for this SchedulerWorker.
std::unique_ptr<Thread> thread_;
- const ThreadPriority thread_priority_;
+ const ThreadPriority priority_hint_;
const std::unique_ptr<Delegate> delegate_;
TaskTracker* const task_tracker_;
« no previous file with comments | « no previous file | base/task_scheduler/scheduler_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698