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

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

Issue 2568793003: Control TaskScheduler initialization params in renderers via field trial. (Closed)
Patch Set: self-review Created 4 years 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 d18c1d214c73f46fc18fdb462244bbf0dd85338c..eaf68e6e8227bb3a837715c5f0ff6c7032bbe246 100644
--- a/components/task_scheduler_util/common/variations_util.h
+++ b/components/task_scheduler_util/common/variations_util.h
@@ -9,9 +9,14 @@
#include <string>
#include <vector>
+#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 {
struct SchedulerConstantWorkerPoolParams {
@@ -31,6 +36,19 @@ std::vector<base::SchedulerWorkerPoolParams> GetWorkerPoolParams(
constant_worker_pool_params_vector,
const std::map<std::string, std::string>& variation_params);
+// Adds key-value pairs from |variation_params| whose key start with
+// |key_prefix| to the --task-scheduler-variation-params switch of
+// |command_line|.
+void AddVariationParamsToCommandLine(
+ const std::map<std::string, std::string> variation_params,
+ base::StringPiece key_prefix,
gab 2016/12/12 17:33:33 Since this is in task_scheduler/, can't it just al
gab 2017/01/05 18:40:05 ping
fdoray 2017/01/06 17:29:03 |prefix| determines which variation params are add
+ base::CommandLine* command_line);
+
+// Returns a map with key-value pairs read from the
+// --task-scheduler-variation-params switch of |command_line|.
+std::map<std::string, std::string> GetVariationParamsFromCommandLine(
+ const base::CommandLine& command_line);
+
} // namespace task_scheduler_util
#endif // COMPONENTS_TASK_SCHEDULER_UTIL_COMMON_VARIATIONS_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698