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 #ifndef COMPONENTS_TASK_SCHEDULER_UTIL_BROWSER_INITIALIZATION_H_ | |
6 #define COMPONENTS_TASK_SCHEDULER_UTIL_BROWSER_INITIALIZATION_H_ | |
7 | |
8 #include <stddef.h> | |
9 | |
10 #include <vector> | |
11 | |
12 #include "build/build_config.h" | |
13 | |
14 namespace base { | |
15 class SchedulerWorkerPoolParams; | |
16 class TaskTraits; | |
17 } | |
18 | |
19 namespace task_scheduler_util { | |
20 | |
21 // Gets a vector of SchedulerWorkerPoolParams to initialize TaskScheduler in the | |
22 // browser based off variations. Returns an empty vector on failure. | |
23 std::vector<base::SchedulerWorkerPoolParams> | |
24 GetBrowserWorkerPoolParamsFromVariations(); | |
25 | |
26 #if defined(OS_IOS) | |
27 // Gets a vector of SchedulerWorkerPoolParams to initialize TaskScheduler in the | |
28 // browser based off default variation params. | |
29 std::vector<base::SchedulerWorkerPoolParams> | |
30 GetDefaultBrowserWorkerPoolParams(); | |
robliao
2016/12/15 21:26:46
This is no longer required with the committed iOS
fdoray
2016/12/15 21:48:49
Done.
| |
31 #endif | |
32 | |
33 // Maps |traits| to the index of a browser worker pool vector provided by | |
34 // GetBrowserWorkerPoolParamsFromVariations() or | |
35 // GetDefaultBrowserWorkerPoolParams(). | |
36 size_t BrowserWorkerPoolIndexForTraits(const base::TaskTraits& traits); | |
37 | |
38 // Redirects zero-to-many PostTask APIs to the browser task scheduler based off | |
39 // variations. | |
40 void MaybePerformBrowserTaskSchedulerRedirection(); | |
41 | |
42 } // namespace task_scheduler_util | |
43 | |
44 #endif // COMPONENTS_TASK_SCHEDULER_UTIL_BROWSER_INITIALIZATION_H_ | |
OLD | NEW |