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

Unified Diff: base/threading/sequenced_worker_pool.h

Issue 2077413009: Add TaskPriority as a parameter to SequencedWorkerPool in preparation for TaskScheduler experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a2_hook
Patch Set: tweak comment Created 4 years, 5 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 | « base/test/sequenced_worker_pool_owner.cc ('k') | base/threading/sequenced_worker_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/sequenced_worker_pool.h
diff --git a/base/threading/sequenced_worker_pool.h b/base/threading/sequenced_worker_pool.h
index cbec39561a40db6fd5d3e773907a0642428d4bcf..b45fad33ecc8be8973c674029d9b13ce7490128a 100644
--- a/base/threading/sequenced_worker_pool.h
+++ b/base/threading/sequenced_worker_pool.h
@@ -17,6 +17,7 @@
#include "base/memory/ref_counted.h"
#include "base/single_thread_task_runner.h"
#include "base/task_runner.h"
+#include "base/task_scheduler/task_traits.h"
namespace tracked_objects {
class Location;
@@ -186,7 +187,18 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner {
// deliberately leak it.
// Pass the maximum number of threads (they will be lazily created as needed)
- // and a prefix for the thread name to aid in debugging.
+ // and a prefix for the thread name to aid in debugging. |task_priority| will
+ // be used to hint base::TaskScheduler for an experiment in which all
+ // SequencedWorkerPool tasks will be redirected to it in processes where a
+ // base::TaskScheduler was instantiated.
+ SequencedWorkerPool(size_t max_threads,
+ const std::string& thread_name_prefix,
+ base::TaskPriority task_priority);
+
+ // Deprecated, use the above constructor with |task_priority| instead.
+ // TODO(gab): Cleanup last few use cases of this before running the
+ // aforementioned base::TaskScheduler experiment (or make sure this
+ // constructor results in callers being opted out of the experiment).
SequencedWorkerPool(size_t max_threads,
const std::string& thread_name_prefix);
@@ -194,6 +206,7 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner {
// |observer|.
SequencedWorkerPool(size_t max_threads,
const std::string& thread_name_prefix,
+ base::TaskPriority task_priority,
TestingObserver* observer);
// Returns the sequence token associated with the given name. Calling this
« no previous file with comments | « base/test/sequenced_worker_pool_owner.cc ('k') | base/threading/sequenced_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698