OLD | NEW |
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 #ifndef COMPONENTS_TASK_SCHEDULER_UTIL_BROWSER_INITIALIZATION_H_ | 5 #ifndef COMPONENTS_TASK_SCHEDULER_UTIL_BROWSER_INITIALIZATION_H_ |
6 #define COMPONENTS_TASK_SCHEDULER_UTIL_BROWSER_INITIALIZATION_H_ | 6 #define COMPONENTS_TASK_SCHEDULER_UTIL_BROWSER_INITIALIZATION_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <memory> |
9 | 9 |
10 #include <memory> | |
11 #include <vector> | |
12 | |
13 #include "base/task_scheduler/scheduler_worker_pool_params.h" | |
14 #include "base/task_scheduler/task_scheduler.h" | 10 #include "base/task_scheduler/task_scheduler.h" |
15 | 11 |
16 namespace base { | |
17 class TaskTraits; | |
18 } | |
19 | |
20 namespace task_scheduler_util { | 12 namespace task_scheduler_util { |
21 | 13 |
22 // Gets a TaskScheduler::InitParams object to initialize TaskScheduler in the | 14 // Gets a TaskScheduler::InitParams object to initialize TaskScheduler in the |
23 // browser based off variations. Returns nullptr on failure. | 15 // browser based off variations. Returns nullptr on failure. |
24 std::unique_ptr<base::TaskScheduler::InitParams> | 16 std::unique_ptr<base::TaskScheduler::InitParams> |
25 GetBrowserTaskSchedulerInitParamsFromVariations(); | 17 GetBrowserTaskSchedulerInitParamsFromVariations(); |
26 | 18 |
27 // Gets a vector of SchedulerWorkerPoolParams to initialize TaskScheduler in the | |
28 // browser based off variations. Returns an empty vector on failure. | |
29 // | |
30 // Deprecated. https://crbug.com/690706 | |
31 std::vector<base::SchedulerWorkerPoolParams> | |
32 GetBrowserWorkerPoolParamsFromVariations(); | |
33 | |
34 // Maps |traits| to the index of a browser worker pool vector provided by | |
35 // GetBrowserWorkerPoolParamsFromVariations(). | |
36 // | |
37 // Deprecated. https://crbug.com/690706 | |
38 size_t BrowserWorkerPoolIndexForTraits(const base::TaskTraits& traits); | |
39 | |
40 // Redirects zero-to-many PostTask APIs to the browser task scheduler based off | 19 // Redirects zero-to-many PostTask APIs to the browser task scheduler based off |
41 // variations. | 20 // variations. |
42 void MaybePerformBrowserTaskSchedulerRedirection(); | 21 void MaybePerformBrowserTaskSchedulerRedirection(); |
43 | 22 |
44 } // namespace task_scheduler_util | 23 } // namespace task_scheduler_util |
45 | 24 |
46 #endif // COMPONENTS_TASK_SCHEDULER_UTIL_BROWSER_INITIALIZATION_H_ | 25 #endif // COMPONENTS_TASK_SCHEDULER_UTIL_BROWSER_INITIALIZATION_H_ |
OLD | NEW |