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

Unified Diff: content/browser/browser_main_loop.cc

Issue 2445763002: Disallow posting tasks to SequencedWorkerPools by default. (Closed)
Patch Set: self-review Created 4 years, 1 month 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 | « components/task_scheduler_util/initialization_util.cc ('k') | content/public/test/browser_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index 5d2ae3e294cc90e8912dad650d6c5f0f3e38c474..70e5627c9c54af4e3ef414f62058feacb4189859 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -31,6 +31,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/system_monitor/system_monitor.h"
+#include "base/threading/sequenced_worker_pool.h"
#include "base/threading/thread_restrictions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/timer/hi_res_timer_manager.h"
@@ -735,6 +736,12 @@ void BrowserMainLoop::PostMainMessageLoopStart() {
}
int BrowserMainLoop::PreCreateThreads() {
+ // SequencedWorkerPool shouldn't be enabled yet. It should be enabled below by
+ // either |parts_|->PreCreateThreads() or
+ // base::SequencedWorkerPool::EnableForProcess().
+ // TODO(fdoray): Uncomment this line.
+ // DCHECK(!base::SequencedWorkerPool::IsEnabled());
+
if (parts_) {
TRACE_EVENT0("startup",
"BrowserMainLoop::CreateThreads:PreCreateThreads");
@@ -742,6 +749,13 @@ int BrowserMainLoop::PreCreateThreads() {
result_code_ = parts_->PreCreateThreads();
}
+ // Enable SequencedWorkerPool if |parts_|->PreCreateThreads() hasn't enabled
+ // it.
+ // TODO(fdoray): Remove this once the SequencedWorkerPool to TaskScheduler
+ // redirection experiment concludes https://crbug.com/622400.
+ if (!base::SequencedWorkerPool::IsEnabled())
+ base::SequencedWorkerPool::EnableForProcess();
+
const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
// Note that we do not initialize a new FeatureList when calling this for
« no previous file with comments | « components/task_scheduler_util/initialization_util.cc ('k') | content/public/test/browser_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698