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_COMMON_VARIATIONS_UTIL_H_ |
| 6 #define COMPONENTS_TASK_SCHEDULER_UTIL_COMMON_VARIATIONS_UTIL_H_ |
| 7 |
| 8 #include <map> |
| 9 #include <string> |
| 10 #include <vector> |
| 11 |
| 12 #include "base/task_scheduler/scheduler_worker_pool_params.h" |
| 13 #include "base/threading/platform_thread.h" |
| 14 |
| 15 namespace task_scheduler_util { |
| 16 |
| 17 class SchedulerImmutableWorkerPoolParams { |
| 18 public: |
| 19 SchedulerImmutableWorkerPoolParams(const char* name, |
| 20 base::ThreadPriority priority_hint); |
| 21 |
| 22 const char* name() const { return name_; } |
| 23 base::ThreadPriority priority_hint() const { return priority_hint_; } |
| 24 |
| 25 private: |
| 26 const char* name_; |
| 27 base::ThreadPriority priority_hint_; |
| 28 }; |
| 29 |
| 30 // Returns a SchedulerWorkerPoolParams vector to initialize pools specified in |
| 31 // |constant_worker_pool_params_vector|. SchedulerWorkerPoolParams members |
| 32 // without a counterpart in SchedulerImmutableWorkerPoolParams are initialized |
| 33 // based of |variation_params|. Returns an empty vector on failure. |
| 34 std::vector<base::SchedulerWorkerPoolParams> GetWorkerPoolParams( |
| 35 const std::vector<SchedulerImmutableWorkerPoolParams>& |
| 36 constant_worker_pool_params_vector, |
| 37 const std::map<std::string, std::string>& variation_params); |
| 38 |
| 39 } // namespace task_scheduler_util |
| 40 |
| 41 #endif // COMPONENTS_TASK_SCHEDULER_UTIL_COMMON_VARIATIONS_UTIL_H_ |
OLD | NEW |