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

Side by Side Diff: components/task_scheduler_util/initialization_util.cc

Issue 2539263003: Move Task Scheduler Initialization From chrome/browser to Content (Closed)
Patch Set: Rebase to bf8e2f1 Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/task_scheduler_util/initialization_util.h" 5 #include "components/task_scheduler_util/initialization_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/task_scheduler/scheduler_worker_pool_params.h" 10 #include "base/task_scheduler/scheduler_worker_pool_params.h"
11 #include "base/task_scheduler/task_scheduler.h" 11 #include "base/task_scheduler/task_scheduler.h"
12 #include "components/task_scheduler_util/initialization/browser_util.h" 12 #include "components/task_scheduler_util/initialization/browser_util.h"
13 #include "components/task_scheduler_util/variations/browser_variations_util.h" 13 #include "components/task_scheduler_util/variations/browser_variations_util.h"
14 14
15 namespace task_scheduler_util { 15 namespace task_scheduler_util {
16 16
17 #if defined(OS_IOS)
17 void InitializeDefaultBrowserTaskScheduler() { 18 void InitializeDefaultBrowserTaskScheduler() {
18 std::vector<base::SchedulerWorkerPoolParams> params_vector = 19 std::vector<base::SchedulerWorkerPoolParams> params_vector =
19 variations::GetBrowserSchedulerWorkerPoolParamsFromVariations(); 20 variations::GetBrowserSchedulerWorkerPoolParamsFromVariations();
20 if (params_vector.empty()) { 21 if (params_vector.empty()) {
21 params_vector = 22 params_vector =
22 initialization::GetDefaultBrowserSchedulerWorkerPoolParams(); 23 initialization::GetDefaultBrowserSchedulerWorkerPoolParams();
23 } 24 }
24 25
25 base::TaskScheduler::CreateAndSetDefaultTaskScheduler( 26 base::TaskScheduler::CreateAndSetDefaultTaskScheduler(
26 params_vector, 27 params_vector,
27 base::Bind(&initialization::BrowserWorkerPoolIndexForTraits)); 28 base::Bind(&initialization::BrowserWorkerPoolIndexForTraits));
28 task_scheduler_util::variations:: 29 task_scheduler_util::variations::
29 MaybePerformBrowserTaskSchedulerRedirection(); 30 MaybePerformBrowserTaskSchedulerRedirection();
30 } 31 }
32 #endif // defined(OS_IOS)
31 33
32 } // namespace task_scheduler_util 34 } // namespace task_scheduler_util
OLDNEW
« no previous file with comments | « components/task_scheduler_util/initialization_util.h ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698