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