| 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..bd8c41e70e0e6b47c5fea3eb13d33988a7cb6588 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,33 @@ class ContentMainRunnerImpl : public ContentMainRunner {
|
| std::string process_type =
|
| command_line.GetSwitchValueASCII(switches::kProcessType);
|
|
|
| + // Initialize statistical testing infrastructure. We set the entropy
|
| + // provider to nullptr 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(nullptr);
|
| +
|
| + // TODO(asvitkine): This logic should run for all child processes.
|
| + // https://crbug.com/563705.
|
| + if (process_type == switches::kGpuProcess ||
|
| + process_type == switches::kUtilityProcess ||
|
| + process_type == switches::kPpapiPluginProcess) {
|
| + // Ensure any field trials in browser are reflected into the child
|
| + // process.
|
| + if (command_line.HasSwitch(switches::kForceFieldTrials)) {
|
| + 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);
|
|
|