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

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

Issue 2568793003: Control TaskScheduler initialization params in renderers via field trial. (Closed)
Patch Set: do not define command line functions on ios Created 3 years, 11 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 aa37d25b2391d370443412bc5607a3a014e2a4e5..bf58e8cdc0142604eaa95929ff22caf82a014d56 100644
--- a/components/task_scheduler_util/common/variations_util.h
+++ b/components/task_scheduler_util/common/variations_util.h
@@ -9,9 +9,15 @@
#include <string>
#include <vector>
+#include "build/build_config.h"
+#include "base/strings/string_piece.h"
#include "base/task_scheduler/scheduler_worker_pool_params.h"
#include "base/threading/platform_thread.h"
+namespace base {
+class CommandLine;
+}
+
namespace task_scheduler_util {
class SchedulerImmutableWorkerPoolParams {
@@ -36,6 +42,19 @@ std::vector<base::SchedulerWorkerPoolParams> GetWorkerPoolParams(
constant_worker_pool_params_vector,
const std::map<std::string, std::string>& variation_params);
+#if !defined(OS_IOS)
+// Serializes variation params from the BrowserScheduler field trial whose key
+// start with |prefix| to the --task-scheduler-variation-params switch of
+// |command_line|.
+void AddVariationParamsToCommandLine(base::StringPiece key_prefix,
+ base::CommandLine* command_line);
+
+// Returns a map of key-value pairs deserialized from the
+// --task-scheduler-variation-params switch of |command_line|.
+std::map<std::string, std::string> GetVariationParamsFromCommandLine(
+ const base::CommandLine& command_line);
+#endif // !defined(OS_IOS)
+
} // namespace task_scheduler_util
#endif // COMPONENTS_TASK_SCHEDULER_UTIL_COMMON_VARIATIONS_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698