| 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_INITIALIZATION_BROWSER_UTIL_H_ | 5 #ifndef COMPONENTS_TASK_SCHEDULER_UTIL_INITIALIZATION_BROWSER_UTIL_H_ |
| 6 #define COMPONENTS_TASK_SCHEDULER_UTIL_INITIALIZATION_BROWSER_UTIL_H_ | 6 #define COMPONENTS_TASK_SCHEDULER_UTIL_INITIALIZATION_BROWSER_UTIL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/task_scheduler/scheduler_worker_pool_params.h" | 10 #include "base/task_scheduler/scheduler_worker_pool_params.h" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "build/build_config.h" |
| 12 | 13 |
| 13 namespace base { | 14 namespace base { |
| 14 class TaskTraits; | 15 class TaskTraits; |
| 15 } | 16 } |
| 16 | 17 |
| 17 namespace task_scheduler_util { | 18 namespace task_scheduler_util { |
| 18 namespace initialization { | 19 namespace initialization { |
| 19 | 20 |
| 20 enum WorkerPoolType : size_t { | 21 enum WorkerPoolType : size_t { |
| 21 BACKGROUND = 0, | 22 BACKGROUND = 0, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 43 // initialization. | 44 // initialization. |
| 44 std::vector<base::SchedulerWorkerPoolParams> | 45 std::vector<base::SchedulerWorkerPoolParams> |
| 45 BrowserWorkerPoolConfigurationToSchedulerWorkerPoolParams( | 46 BrowserWorkerPoolConfigurationToSchedulerWorkerPoolParams( |
| 46 const BrowserWorkerPoolsConfiguration& config); | 47 const BrowserWorkerPoolsConfiguration& config); |
| 47 | 48 |
| 48 // Maps |traits| to the index of a browser worker pool vector provided by | 49 // Maps |traits| to the index of a browser worker pool vector provided by |
| 49 // BrowserWorkerPoolConfigurationToSchedulerWorkerPoolParams() or | 50 // BrowserWorkerPoolConfigurationToSchedulerWorkerPoolParams() or |
| 50 // GetDefaultBrowserSchedulerWorkerPoolParams(). | 51 // GetDefaultBrowserSchedulerWorkerPoolParams(). |
| 51 size_t BrowserWorkerPoolIndexForTraits(const base::TaskTraits& traits); | 52 size_t BrowserWorkerPoolIndexForTraits(const base::TaskTraits& traits); |
| 52 | 53 |
| 54 #if defined(OS_IOS) |
| 53 // Returns the default browser scheduler worker pool params. | 55 // Returns the default browser scheduler worker pool params. |
| 54 std::vector<base::SchedulerWorkerPoolParams> | 56 std::vector<base::SchedulerWorkerPoolParams> |
| 55 GetDefaultBrowserSchedulerWorkerPoolParams(); | 57 GetDefaultBrowserSchedulerWorkerPoolParams(); |
| 58 #endif // defined(OS_IOS) |
| 56 | 59 |
| 57 } // namespace initialization | 60 } // namespace initialization |
| 58 } // namespace task_scheduler_util | 61 } // namespace task_scheduler_util |
| 59 | 62 |
| 60 #endif // COMPONENTS_TASK_SCHEDULER_UTIL_INITIALIZATION_BROWSER_UTIL_H_ | 63 #endif // COMPONENTS_TASK_SCHEDULER_UTIL_INITIALIZATION_BROWSER_UTIL_H_ |
| OLD | NEW |