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

Unified Diff: ios/web/app/web_main_loop.mm

Issue 2841943005: Create TaskScheduler in WebMainLoop 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: ios/web/app/web_main_loop.mm
diff --git a/ios/web/app/web_main_loop.mm b/ios/web/app/web_main_loop.mm
index 55c274d563a0a3a896c8c27468e29b3ba44f22da..8d79449be3023452cbfe2834bf872f91d0b2ff88 100644
--- a/ios/web/app/web_main_loop.mm
+++ b/ios/web/app/web_main_loop.mm
@@ -71,6 +71,10 @@ WebMainLoop* g_current_web_main_loop = nullptr;
WebMainLoop::WebMainLoop() : result_code_(0), created_threads_(false) {
DCHECK(!g_current_web_main_loop);
g_current_web_main_loop = this;
+
+ // Use an empty string as TaskScheduler name to match the suffix of browser
+ // process TaskScheduler histograms.
+ base::TaskScheduler::Create("");
}
WebMainLoop::~WebMainLoop() {
@@ -145,14 +149,15 @@ int WebMainLoop::PreCreateThreads() {
}
int WebMainLoop::CreateThreads() {
- auto task_scheduler_init_params =
- GetWebClient()->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 =
+ GetWebClient()->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());
+ }
GetWebClient()->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