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

Unified Diff: components/task_scheduler_util/common/variations_util.h

Issue 2788223002: Generate TaskScheduler::InitParams from components/task_scheduler_util/. (Closed)
Patch Set: fix-build-error Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: components/task_scheduler_util/common/variations_util.h
diff --git a/components/task_scheduler_util/common/variations_util.h b/components/task_scheduler_util/common/variations_util.h
index f92b29770084ae9117d3cbebe36b907fb98a86cf..3fd49ce7a765e59911e72ec3761313a8788f5dd6 100644
--- a/components/task_scheduler_util/common/variations_util.h
+++ b/components/task_scheduler_util/common/variations_util.h
@@ -6,14 +6,13 @@
#define COMPONENTS_TASK_SCHEDULER_UTIL_COMMON_VARIATIONS_UTIL_H_
#include <map>
+#include <memory>
#include <string>
-#include <vector>
-#include "build/build_config.h"
#include "base/strings/string_piece.h"
#include "base/task_scheduler/scheduler_worker_params.h"
-#include "base/task_scheduler/scheduler_worker_pool_params.h"
-#include "base/threading/platform_thread.h"
+#include "base/task_scheduler/task_scheduler.h"
+#include "build/build_config.h"
namespace base {
class CommandLine;
@@ -21,34 +20,16 @@ class CommandLine;
namespace task_scheduler_util {
-class SchedulerImmutableWorkerPoolParams {
- public:
- SchedulerImmutableWorkerPoolParams(
- const char* name,
- base::ThreadPriority priority_hint,
- base::SchedulerBackwardCompatibility backward_compatibility =
- base::SchedulerBackwardCompatibility::DISABLED);
-
- const char* name() const { return name_; }
- base::ThreadPriority priority_hint() const { return priority_hint_; }
- base::SchedulerBackwardCompatibility backward_compatibility() const {
- return backward_compatibility_;
- }
-
- private:
- const char* name_;
- base::ThreadPriority priority_hint_;
- base::SchedulerBackwardCompatibility backward_compatibility_;
-};
-
-// Returns a SchedulerWorkerPoolParams vector to initialize pools specified in
-// |constant_worker_pool_params_vector|. SchedulerWorkerPoolParams members
-// without a counterpart in SchedulerImmutableWorkerPoolParams are initialized
-// based of |variation_params|. Returns an empty vector on failure.
-std::vector<base::SchedulerWorkerPoolParams> GetWorkerPoolParams(
- const std::vector<SchedulerImmutableWorkerPoolParams>&
- constant_worker_pool_params_vector,
- const std::map<std::string, std::string>& variation_params);
+// Builds a TaskScheduler::InitParams from pool descriptors in
+// |variations_params| that are prefixed with |variation_param_prefix|.
+// |foreground_blocking_backward_compatibility| controls backward compatibility
+// in the foreground blocking pool. Returns nullptr on failure.
+std::unique_ptr<base::TaskScheduler::InitParams> GetTaskSchedulerInitParams(
+ base::StringPiece variation_param_prefix,
+ const std::map<std::string, std::string>& variation_params,
+ base::SchedulerBackwardCompatibility
+ foreground_blocking_backward_compatibility =
+ base::SchedulerBackwardCompatibility::DISABLED);
#if !defined(OS_IOS)
// Serializes variation params from the BrowserScheduler field trial whose key
« no previous file with comments | « components/task_scheduler_util/browser/initialization.cc ('k') | components/task_scheduler_util/common/variations_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698