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(); |