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

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

Issue 2749303002: [reference - do not submit] Always create four pools in TaskSchedulerImpl. (Closed)
Patch Set: rebase Created 3 years, 9 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 #include "base/task_scheduler/scheduler_worker_pool_params.h" 5 #include "base/task_scheduler/scheduler_worker_pool_params.h"
6 6
7 namespace base { 7 namespace base {
8 8
9 SchedulerWorkerPoolParams::SchedulerWorkerPoolParams()
10 : standby_thread_policy_(StandbyThreadPolicy::ONE),
11 max_threads_(0),
12 backward_compatibility_(SchedulerBackwardCompatibility::DISABLED) {}
13
9 SchedulerWorkerPoolParams::SchedulerWorkerPoolParams( 14 SchedulerWorkerPoolParams::SchedulerWorkerPoolParams(
10 const std::string& name,
11 ThreadPriority priority_hint,
12 StandbyThreadPolicy standby_thread_policy, 15 StandbyThreadPolicy standby_thread_policy,
13 int max_threads, 16 int max_threads,
14 TimeDelta suggested_reclaim_time, 17 TimeDelta suggested_reclaim_time,
15 SchedulerBackwardCompatibility backward_compatibility) 18 SchedulerBackwardCompatibility backward_compatibility)
16 : name_(name), 19 : standby_thread_policy_(standby_thread_policy),
17 priority_hint_(priority_hint),
18 standby_thread_policy_(standby_thread_policy),
19 max_threads_(max_threads), 20 max_threads_(max_threads),
20 suggested_reclaim_time_(suggested_reclaim_time), 21 suggested_reclaim_time_(suggested_reclaim_time),
21 backward_compatibility_(backward_compatibility) {} 22 backward_compatibility_(backward_compatibility) {}
22 23
23 SchedulerWorkerPoolParams::SchedulerWorkerPoolParams( 24 SchedulerWorkerPoolParams::SchedulerWorkerPoolParams(
24 const SchedulerWorkerPoolParams& other) = default; 25 const SchedulerWorkerPoolParams& other) = default;
25 26
26 SchedulerWorkerPoolParams& SchedulerWorkerPoolParams::operator=( 27 SchedulerWorkerPoolParams& SchedulerWorkerPoolParams::operator=(
27 const SchedulerWorkerPoolParams& other) = default; 28 const SchedulerWorkerPoolParams& other) = default;
28 29
30 bool SchedulerWorkerPoolParams::IsValid() const {
31 return max_threads_ > 0 && suggested_reclaim_time_ >= TimeDelta();
32 }
33
29 } // namespace base 34 } // namespace base
OLDNEW
« no previous file with comments | « base/task_scheduler/scheduler_worker_pool_params.h ('k') | base/task_scheduler/task_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698