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

Unified Diff: content/browser/browser_main_loop.cc

Issue 2835933004: Create TaskScheduler in BrowserMainLoop constructor. (Closed)
Patch Set: Created 3 years, 8 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 | no next file » | 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 5021cd5c45c38f59493fbb778338da8fff3082a0..924a2d254e530095a20d5468579e891a40cc34f4 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -532,6 +532,8 @@ BrowserMainLoop::BrowserMainLoop(const MainFunctionParams& parameters)
tracing::TraceConfigFile::GetInstance()->GetStartupDuration() > 0)) {
DCHECK(!g_current_browser_main_loop);
g_current_browser_main_loop = this;
+
+ base::TaskScheduler::Create("");
robliao 2017/04/24 18:15:54 Should we be more aggressive about the creation po
gab 2017/04/25 15:29:15 Agreed for ASAP but this is essentially the same l
robliao 2017/04/25 17:21:30 I think this change is fine for now, but given tha
}
robliao 2017/04/25 17:21:30 Document the use of "".
BrowserMainLoop::~BrowserMainLoop() {
@@ -952,14 +954,15 @@ void BrowserMainLoop::CreateStartupTasks() {
int BrowserMainLoop::CreateThreads() {
TRACE_EVENT0("startup,rail", "BrowserMainLoop::CreateThreads");
- auto task_scheduler_init_params =
- GetContentClient()->browser()->GetTaskSchedulerInitParams();
- if (!task_scheduler_init_params)
- task_scheduler_init_params = GetDefaultTaskSchedulerInitParams();
- DCHECK(task_scheduler_init_params);
-
- base::TaskScheduler::CreateAndSetDefaultTaskScheduler(
- "", *task_scheduler_init_params.get());
+ {
+ auto task_scheduler_init_params =
+ GetContentClient()->browser()->GetTaskSchedulerInitParams();
+ if (!task_scheduler_init_params)
+ task_scheduler_init_params = GetDefaultTaskSchedulerInitParams();
+ DCHECK(task_scheduler_init_params);
+ base::TaskScheduler::GetInstance()->Start(
+ *task_scheduler_init_params.get());
+ }
GetContentClient()->browser()->PerformExperimentalTaskSchedulerRedirections();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698