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

Unified Diff: base/threading/sequenced_worker_pool.h

Issue 2241703002: Add an experiment to redirect SequencedWorkerPool tasks to TaskScheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b3_delay_metrics_blocking
Patch Set: self-review 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/threading/sequenced_worker_pool.cc » ('j') | base/threading/sequenced_worker_pool.cc » ('J')
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 0a4e476b2e2b2c716fdd9ddcfe55b420f5d1a39b..0e916c8782bbfe9e0230e2ec1a73d32f0a513680 100644
--- a/base/threading/sequenced_worker_pool.h
+++ b/base/threading/sequenced_worker_pool.h
@@ -172,6 +172,17 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner {
// PostSequencedWorkerTask(). Valid tokens are always nonzero.
static SequenceToken GetSequenceToken();
+ // Invoke this once on the main thread of a process, before any other threads
+ // are created and before any tasks are posted to that process'
+ // SequencedWorkerPools but after TaskScheduler was instantiated, to force all
+ // SequencedWorkerPools in that process to redirect their tasks to the
+ // TaskScheduler. Note: SequencedWorkerPool instances with |max_threads == 1|
+ // will be special cased to send all of their work as
+ // ExecutionMode::SINGLE_THREADED.
+ // TODO(gab): Remove this if http://crbug.com/622400 fails
+ // (SequencedWorkerPool will be phased out completely otherwise).
+ static void RedirectSequencedWorkerPoolsToTaskSchedulerForProcess();
+
// When constructing a SequencedWorkerPool, there must be a
// ThreadTaskRunnerHandle on the current thread unless you plan to
// deliberately leak it.
« no previous file with comments | « no previous file | base/threading/sequenced_worker_pool.cc » ('j') | base/threading/sequenced_worker_pool.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698