| 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 BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_PARAMS_H_ | 5 #ifndef BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_PARAMS_H_ |
| 6 #define BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_PARAMS_H_ | 6 #define BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_PARAMS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" |
| 10 #include "base/task_scheduler/scheduler_worker_params.h" | 11 #include "base/task_scheduler/scheduler_worker_params.h" |
| 11 #include "base/threading/platform_thread.h" | 12 #include "base/threading/platform_thread.h" |
| 12 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 13 | 14 |
| 14 namespace base { | 15 namespace base { |
| 15 | 16 |
| 16 class BASE_EXPORT SchedulerWorkerPoolParams final { | 17 class BASE_EXPORT SchedulerWorkerPoolParams final { |
| 17 public: | 18 public: |
| 18 enum class StandbyThreadPolicy { | 19 enum class StandbyThreadPolicy { |
| 19 // Create threads as needed on demand, reclaimed as necessary. | 20 // Create threads as needed on demand, reclaimed as necessary. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 34 // value for performance or correctness reasons. |backward_compatibility| | 35 // value for performance or correctness reasons. |backward_compatibility| |
| 35 // indicates whether backward compatibility is enabled. | 36 // indicates whether backward compatibility is enabled. |
| 36 SchedulerWorkerPoolParams( | 37 SchedulerWorkerPoolParams( |
| 37 const std::string& name, | 38 const std::string& name, |
| 38 ThreadPriority priority_hint, | 39 ThreadPriority priority_hint, |
| 39 StandbyThreadPolicy standby_thread_policy, | 40 StandbyThreadPolicy standby_thread_policy, |
| 40 int max_threads, | 41 int max_threads, |
| 41 TimeDelta suggested_reclaim_time, | 42 TimeDelta suggested_reclaim_time, |
| 42 SchedulerBackwardCompatibility backward_compatibility = | 43 SchedulerBackwardCompatibility backward_compatibility = |
| 43 SchedulerBackwardCompatibility::DISABLED); | 44 SchedulerBackwardCompatibility::DISABLED); |
| 44 SchedulerWorkerPoolParams(const SchedulerWorkerPoolParams& other); | 45 SchedulerWorkerPoolParams(SchedulerWorkerPoolParams&& other); |
| 45 SchedulerWorkerPoolParams& operator=(const SchedulerWorkerPoolParams& other); | 46 SchedulerWorkerPoolParams& operator=(SchedulerWorkerPoolParams&& other); |
| 46 | 47 |
| 47 const std::string& name() const { return name_; } | 48 const std::string& name() const { return name_; } |
| 48 ThreadPriority priority_hint() const { return priority_hint_; } | 49 ThreadPriority priority_hint() const { return priority_hint_; } |
| 49 StandbyThreadPolicy standby_thread_policy() const { | 50 StandbyThreadPolicy standby_thread_policy() const { |
| 50 return standby_thread_policy_; | 51 return standby_thread_policy_; |
| 51 } | 52 } |
| 52 size_t max_threads() const { return max_threads_; } | 53 size_t max_threads() const { return max_threads_; } |
| 53 TimeDelta suggested_reclaim_time() const { return suggested_reclaim_time_; } | 54 TimeDelta suggested_reclaim_time() const { return suggested_reclaim_time_; } |
| 54 SchedulerBackwardCompatibility backward_compatibility() const { | 55 SchedulerBackwardCompatibility backward_compatibility() const { |
| 55 return backward_compatibility_; | 56 return backward_compatibility_; |
| 56 } | 57 } |
| 57 | 58 |
| 58 private: | 59 private: |
| 59 std::string name_; | 60 std::string name_; |
| 60 ThreadPriority priority_hint_; | 61 ThreadPriority priority_hint_; |
| 61 StandbyThreadPolicy standby_thread_policy_; | 62 StandbyThreadPolicy standby_thread_policy_; |
| 62 size_t max_threads_; | 63 size_t max_threads_; |
| 63 TimeDelta suggested_reclaim_time_; | 64 TimeDelta suggested_reclaim_time_; |
| 64 SchedulerBackwardCompatibility backward_compatibility_; | 65 SchedulerBackwardCompatibility backward_compatibility_; |
| 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(SchedulerWorkerPoolParams); |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 } // namespace base | 70 } // namespace base |
| 68 | 71 |
| 69 #endif // BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_PARAMS_H_ | 72 #endif // BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_PARAMS_H_ |
| OLD | NEW |