Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(673)

Side by Side Diff: base/task_scheduler/scheduler_worker_pool_params.h

Issue 2650383007: Move Task Scheduler Single Thread Task Runners to Dedicated Threads (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/macros.h"
fdoray 2017/01/27 16:47:35 Not needed anymore.
robliao 2017/01/27 21:25:41 Done.
11 #include "base/task_scheduler/scheduler_worker_params.h" 11 #include "base/task_scheduler/scheduler_worker_params.h"
12 #include "base/threading/platform_thread.h" 12 #include "base/threading/platform_thread.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 14
15 namespace base { 15 namespace base {
16 16
17 class BASE_EXPORT SchedulerWorkerPoolParams final { 17 class BASE_EXPORT SchedulerWorkerPoolParams final {
18 public: 18 public:
19 enum class StandbyThreadPolicy { 19 enum class StandbyThreadPolicy {
20 // 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
35 // value for performance or correctness reasons. |backward_compatibility| 35 // value for performance or correctness reasons. |backward_compatibility|
36 // indicates whether backward compatibility is enabled. 36 // indicates whether backward compatibility is enabled.
37 SchedulerWorkerPoolParams( 37 SchedulerWorkerPoolParams(
38 const std::string& name, 38 const std::string& name,
39 ThreadPriority priority_hint, 39 ThreadPriority priority_hint,
40 StandbyThreadPolicy standby_thread_policy, 40 StandbyThreadPolicy standby_thread_policy,
41 int max_threads, 41 int max_threads,
42 TimeDelta suggested_reclaim_time, 42 TimeDelta suggested_reclaim_time,
43 SchedulerBackwardCompatibility backward_compatibility = 43 SchedulerBackwardCompatibility backward_compatibility =
44 SchedulerBackwardCompatibility::DISABLED); 44 SchedulerBackwardCompatibility::DISABLED);
45 SchedulerWorkerPoolParams(const SchedulerWorkerPoolParams& other);
46 SchedulerWorkerPoolParams& operator=(const SchedulerWorkerPoolParams& other);
45 SchedulerWorkerPoolParams(SchedulerWorkerPoolParams&& other); 47 SchedulerWorkerPoolParams(SchedulerWorkerPoolParams&& other);
fdoray 2017/01/27 16:47:35 You can remove lines 47-48. These methods pretend
robliao 2017/01/27 21:25:41 Done.
46 SchedulerWorkerPoolParams& operator=(SchedulerWorkerPoolParams&& other); 48 SchedulerWorkerPoolParams& operator=(SchedulerWorkerPoolParams&& other);
47 49
48 const std::string& name() const { return name_; } 50 const std::string& name() const { return name_; }
49 ThreadPriority priority_hint() const { return priority_hint_; } 51 ThreadPriority priority_hint() const { return priority_hint_; }
50 StandbyThreadPolicy standby_thread_policy() const { 52 StandbyThreadPolicy standby_thread_policy() const {
51 return standby_thread_policy_; 53 return standby_thread_policy_;
52 } 54 }
53 size_t max_threads() const { return max_threads_; } 55 size_t max_threads() const { return max_threads_; }
54 TimeDelta suggested_reclaim_time() const { return suggested_reclaim_time_; } 56 TimeDelta suggested_reclaim_time() const { return suggested_reclaim_time_; }
55 SchedulerBackwardCompatibility backward_compatibility() const { 57 SchedulerBackwardCompatibility backward_compatibility() const {
56 return backward_compatibility_; 58 return backward_compatibility_;
57 } 59 }
58 60
59 private: 61 private:
60 std::string name_; 62 std::string name_;
61 ThreadPriority priority_hint_; 63 ThreadPriority priority_hint_;
62 StandbyThreadPolicy standby_thread_policy_; 64 StandbyThreadPolicy standby_thread_policy_;
63 size_t max_threads_; 65 size_t max_threads_;
64 TimeDelta suggested_reclaim_time_; 66 TimeDelta suggested_reclaim_time_;
65 SchedulerBackwardCompatibility backward_compatibility_; 67 SchedulerBackwardCompatibility backward_compatibility_;
66
67 DISALLOW_COPY_AND_ASSIGN(SchedulerWorkerPoolParams);
68 }; 68 };
69 69
70 } // namespace base 70 } // namespace base
71 71
72 #endif // BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_PARAMS_H_ 72 #endif // BASE_TASK_SCHEDULER_SCHEDULER_WORKER_POOL_PARAMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698