| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/task_scheduler_util/initialization_util.h" | |
| 6 | |
| 7 #include <vector> | |
| 8 | |
| 9 #include "base/bind.h" | |
| 10 #include "base/task_scheduler/scheduler_worker_pool_params.h" | |
| 11 #include "base/task_scheduler/task_scheduler.h" | |
| 12 #include "components/task_scheduler_util/initialization/browser_util.h" | |
| 13 #include "components/task_scheduler_util/variations/browser_variations_util.h" | |
| 14 | |
| 15 namespace task_scheduler_util { | |
| 16 | |
| 17 #if defined(OS_IOS) | |
| 18 void InitializeDefaultBrowserTaskScheduler() { | |
| 19 std::vector<base::SchedulerWorkerPoolParams> params_vector = | |
| 20 variations::GetBrowserSchedulerWorkerPoolParamsFromVariations(); | |
| 21 if (params_vector.empty()) { | |
| 22 params_vector = | |
| 23 initialization::GetDefaultBrowserSchedulerWorkerPoolParams(); | |
| 24 } | |
| 25 | |
| 26 base::TaskScheduler::CreateAndSetDefaultTaskScheduler( | |
| 27 params_vector, | |
| 28 base::Bind(&initialization::BrowserWorkerPoolIndexForTraits)); | |
| 29 task_scheduler_util::variations:: | |
| 30 MaybePerformBrowserTaskSchedulerRedirection(); | |
| 31 } | |
| 32 #endif // defined(OS_IOS) | |
| 33 | |
| 34 } // namespace task_scheduler_util | |
| OLD | NEW |