blob: eb8328a35bd2f156f8789517379513ed408b5d29 [file] [log] [blame]
fdoray4b4ca6522016-12-19 15:58:371// Copyright 2016 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Francois Doray02af3e82018-04-13 13:04:225#ifndef COMPONENTS_TASK_SCHEDULER_UTIL_VARIATIONS_UTIL_H_
6#define COMPONENTS_TASK_SCHEDULER_UTIL_VARIATIONS_UTIL_H_
fdoray4b4ca6522016-12-19 15:58:377
fdorayfd083b72017-04-04 13:45:018#include <memory>
fdoray4b4ca6522016-12-19 15:58:379
Etienne Pierre-Doray30c87612018-12-10 23:23:4310#include "base/feature_list.h"
fdoray1e3963f2017-01-07 00:30:2911#include "base/strings/string_piece.h"
Gabriel Charette44db1422018-08-06 11:19:3312#include "base/task/task_scheduler/task_scheduler.h"
fdoray1e3963f2017-01-07 00:30:2913
fdoray4b4ca6522016-12-19 15:58:3714namespace task_scheduler_util {
15
Etienne Pierre-Doray30c87612018-12-10 23:23:4316extern const base::Feature kBrowserSchedulerInitParams;
17extern const base::Feature kRendererSchedulerInitParams;
18
Francois Doray9626f0d2018-02-08 19:06:2919// Builds a TaskScheduler::InitParams from variations params that are prefixed
Etienne Pierre-Doray30c87612018-12-10 23:23:4320// for |feature|. Returns nullptr on failure.
Francois Doray7f56fd82018-02-16 14:49:4521//
22// TODO(fdoray): Move this to the anonymous namespace in the .cc file.
23// https://crbug.com/810049
Francois Doray9626f0d2018-02-08 19:06:2924std::unique_ptr<base::TaskScheduler::InitParams> GetTaskSchedulerInitParams(
Etienne Pierre-Doray30c87612018-12-10 23:23:4325 const base::Feature& feature);
Francois Doray9626f0d2018-02-08 19:06:2926
Francois Doray7f56fd82018-02-16 14:49:4527// Builds a TaskScheduler::InitParams to use in the browser process from
28// variation params in the BrowserScheduler field trial.
29std::unique_ptr<base::TaskScheduler::InitParams>
30GetTaskSchedulerInitParamsForBrowser();
31
32// Builds a TaskScheduler::InitParams to use in renderer processes from
33// variation params in the BrowserScheduler field trial.
34std::unique_ptr<base::TaskScheduler::InitParams>
35GetTaskSchedulerInitParamsForRenderer();
36
fdoray4b4ca6522016-12-19 15:58:3737} // namespace task_scheduler_util
38
Francois Doray02af3e82018-04-13 13:04:2239#endif // COMPONENTS_TASK_SCHEDULER_UTIL_VARIATIONS_UTIL_H_