| 6 | #define BASE_TASK_TASK_FEATURES_H_ |
| 7 |
| 8 | #include "base/base_export.h" |
| 9 | #include "base/metrics/field_trial_params.h" |
| 10 | #include "build/build_config.h" |
| 11 |
| 12 | namespace base { |
| 13 |
| 14 | struct Feature; |
| 15 |
| 16 | extern const BASE_EXPORT Feature kAllTasksUserBlocking; |
| 17 |
| 18 | // Under this feature, unused threads in ThreadGroup are only detached |
| 19 | // if the total number of threads in the pool is above the initial capacity. |
| 20 | extern const BASE_EXPORT Feature kNoDetachBelowInitialCapacity; |
| 21 |
| 22 | // Under this feature, workers blocked with MayBlock are replaced immediately |
| 23 | // instead of waiting for a threshold in the foreground thread group. |
| 24 | extern const BASE_EXPORT Feature kMayBlockWithoutDelay; |
| 25 |
| 26 | // Under this feature, best effort capacity is never increased. |
| 27 | // While it's unlikely we'd ship this as-is, this experiment allows us to |
| 28 | // determine whether blocked worker replacement logic on best-effort tasks has |
| 29 | // any impact on guardian metrics. |
| 30 | extern const BASE_EXPORT Feature kFixedMaxBestEffortTasks; |
| 31 |
| 32 | #if defined(OS_WIN) || defined(OS_MACOSX) |
| 33 | #define HAS_NATIVE_THREAD_POOL() 1 |
| 34 | #else |
| 35 | #define HAS_NATIVE_THREAD_POOL() 0 |
| 36 | #endif |
| 37 |
| 38 | #if HAS_NATIVE_THREAD_POOL() |
| 39 | // Under this feature, ThreadPoolImpl will use a ThreadGroup backed by a |
| 40 | // native thread pool implementation. The Windows Thread Pool API and |
| 41 | // libdispatch are used on Windows and macOS/iOS respectively. |
| 42 | extern const BASE_EXPORT Feature kUseNativeThreadPool; |
| 43 | #endif |
| 44 |
| 45 | // Whether threads in the ThreadPool should be reclaimed after being idle for 5 |
| 46 | // minutes, instead of 30 seconds. |
| 47 | extern const BASE_EXPORT Feature kUseFiveMinutesThreadReclaimTime; |
| 48 |
| 49 | } // namespace base |
| 50 |
| 51 | #endif // BASE_TASK_TASK_FEATURES_H_ |
| 52 |