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

Unified Diff: content/app/content_main_runner.cc

Issue 1928863002: Enable FeatureList for the GPU process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/content_main_runner.cc
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index abe4f13051c45db0ac11f31e7ef09b59fe3f618b..c122ad8be12552f4c39c81b346847f9f77ad546c 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -15,15 +15,18 @@
#include "base/allocator/allocator_check.h"
#include "base/allocator/allocator_extension.h"
#include "base/at_exit.h"
+#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/debug/debugger.h"
#include "base/debug/stack_trace.h"
+#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/i18n/icu_util.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/scoped_vector.h"
+#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_base.h"
#include "base/metrics/statistics_recorder.h"
#include "base/path_service.h"
@@ -729,6 +732,32 @@ class ContentMainRunnerImpl : public ContentMainRunner {
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
+ // TODO(asvitkine): This logic should run for all child processes.
Alexei Svitkine (slow) 2016/04/28 15:23:33 Thanks! You can add 563705 to the BUG= line of thi
erikchen 2016/04/29 17:45:04 Done.
+ if (process_type == switches::kGpuProcess ||
+ process_type == switches::kUtilityProcess ||
+ process_type == switches::kPpapiPluginProcess) {
+ // Initialize statistical testing infrastructure. We set the entropy
+ // provider to NULL to disallow non-browser processes from creating their
+ // own one-time randomized trials; they should be created in the browser
+ // process.
+ base::FieldTrialList field_trial_list(NULL);
Alexei Svitkine (slow) 2016/04/28 15:23:33 This is not correct. The FieldTrialList should sta
erikchen 2016/04/29 17:45:04 You keep talking about "the loop". Are you referri
Alexei Svitkine (slow) 2016/04/29 18:06:31 Woops, when I said "loop" I meant "if". Sorry for
+
+ // Ensure any field trials in browser are reflected into the child
+ // process.
+ if (command_line.HasSwitch(switches::kForceFieldTrials)) {
Alexei Svitkine (slow) 2016/04/28 15:23:33 It would be good to check whether we propagate thi
erikchen 2016/04/29 17:45:04 We weren't propagating it. I added it to ChildProc
+ bool result = base::FieldTrialList::CreateTrialsFromString(
+ command_line.GetSwitchValueASCII(switches::kForceFieldTrials),
+ std::set<std::string>());
+ DCHECK(result);
+ }
+
+ std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
+ feature_list->InitializeFromCommandLine(
+ command_line.GetSwitchValueASCII(switches::kEnableFeatures),
+ command_line.GetSwitchValueASCII(switches::kDisableFeatures));
+ base::FeatureList::SetInstance(std::move(feature_list));
+ }
+
base::HistogramBase::EnableActivityReportHistogram(process_type);
MainFunctionParams main_params(command_line);
« no previous file with comments | « no previous file | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698