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

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

Issue 2788223002: Generate TaskScheduler::InitParams from components/task_scheduler_util/. (Closed)
Patch Set: add missing include Created 3 years, 9 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..b5273c4664fbfdefe8604a9695d0d11a5e52129c 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"
namespace base {
class CommandLine;
@@ -21,34 +20,23 @@ 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);
robliao 2017/04/03 17:42:36 The browser and renderer have the same pool config
fdoray 2017/04/03 19:01:44 Done.
+// Builds a SchedulerWorkerPoolParams from |pool_descriptor| and
+// |backward_compatibility|. Returns an invalid SchedulerWorkerPoolParams on
+// failure.
+//
+// |pool_descriptor| is a semi-colon separated value string with the following
+// items:
+// 0. Minimum Thread Count (int)
+// 1. Maximum Thread Count (int)
+// 2. Thread Count Multiplier (double)
+// 3. Thread Count Offset (int)
+// 4. Detach Time in Milliseconds (int)
+// 5. Standby Thread Policy (string)
+// Additional values may appear as necessary and will be ignored.
+std::unique_ptr<base::SchedulerWorkerPoolParams> StringToWorkerPoolParams(
+ const base::StringPiece pool_descriptor,
+ base::SchedulerBackwardCompatibility backward_compatibility =
+ base::SchedulerBackwardCompatibility::DISABLED);
#if !defined(OS_IOS)
// Serializes variation params from the BrowserScheduler field trial whose key

Powered by Google App Engine
This is Rietveld 408576698