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 <map> |
| 11 #include <string> |
| 12 #include <vector> |
| 13 |
| 14 #include "base/task_scheduler/scheduler_worker_pool_params.h" |
| 15 |
| 16 namespace base { |
| 17 class TaskTraits; |
| 18 } |
| 19 |
| 20 namespace task_scheduler_util { |
| 21 |
| 22 // Gets a vector of SchedulerWorkerPoolParams to initialize TaskScheduler in the |
| 23 // browser based off |variation_params|. Returns an empty vector if |
| 24 // |variation_params| has missing or invalid values. |
| 25 std::vector<base::SchedulerWorkerPoolParams> GetBrowserWorkerPoolParams( |
| 26 const std::map<std::string, std::string>& variation_params); |
| 27 |
| 28 // Maps |traits| to the index of a browser worker pool vector provided by |
| 29 // GetBrowserWorkerPoolParams(). |
| 30 size_t BrowserWorkerPoolIndexForTraits(const base::TaskTraits& traits); |
| 31 |
| 32 // Redirects zero-to-many PostTask APIs to the browser task scheduler based off |
| 33 // |variation_params|. |
| 34 void MaybePerformBrowserTaskSchedulerRedirection( |
| 35 const std::map<std::string, std::string>& variation_params); |
| 36 |
| 37 } // namespace task_scheduler_util |
| 38 |
| 39 #endif // COMPONENTS_TASK_SCHEDULER_UTIL_BROWSER_INITIALIZATION_H_ |
OLD | NEW |