| Index: components/task_scheduler_util/browser/initialization.h
|
| diff --git a/components/task_scheduler_util/browser/initialization.h b/components/task_scheduler_util/browser/initialization.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d1b52ba558c56df070f627eb126e44fa4cf3506f
|
| --- /dev/null
|
| +++ b/components/task_scheduler_util/browser/initialization.h
|
| @@ -0,0 +1,39 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef COMPONENTS_TASK_SCHEDULER_UTIL_BROWSER_INITIALIZATION_H_
|
| +#define COMPONENTS_TASK_SCHEDULER_UTIL_BROWSER_INITIALIZATION_H_
|
| +
|
| +#include <stddef.h>
|
| +
|
| +#include <map>
|
| +#include <string>
|
| +#include <vector>
|
| +
|
| +#include "base/task_scheduler/scheduler_worker_pool_params.h"
|
| +
|
| +namespace base {
|
| +class TaskTraits;
|
| +}
|
| +
|
| +namespace task_scheduler_util {
|
| +
|
| +// Gets a vector of SchedulerWorkerPoolParams to initialize TaskScheduler in the
|
| +// browser based off |variation_params|. Returns an empty vector if
|
| +// |variation_params| has missing or invalid values.
|
| +std::vector<base::SchedulerWorkerPoolParams> GetBrowserWorkerPoolParams(
|
| + const std::map<std::string, std::string>& variation_params);
|
| +
|
| +// Maps |traits| to the index of a browser worker pool vector provided by
|
| +// GetBrowserWorkerPoolParams().
|
| +size_t BrowserWorkerPoolIndexForTraits(const base::TaskTraits& traits);
|
| +
|
| +// Redirects zero-to-many PostTask APIs to the browser task scheduler based off
|
| +// |variation_params|.
|
| +void MaybePerformBrowserTaskSchedulerRedirection(
|
| + const std::map<std::string, std::string>& variation_params);
|
| +
|
| +} // namespace task_scheduler_util
|
| +
|
| +#endif // COMPONENTS_TASK_SCHEDULER_UTIL_BROWSER_INITIALIZATION_H_
|
|
|