Chromium Code Reviews| Index: content/app/content_main_runner.cc |
| diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc |
| index 9d92e28e19c5d1133b7af61925cf10f53b04fe4d..8b8d29105fa4fb9bc35fb61fd3f465769d29d597 100644 |
| --- a/content/app/content_main_runner.cc |
| +++ b/content/app/content_main_runner.cc |
| @@ -144,8 +144,16 @@ void InitializeFieldTrialAndFeatureList( |
| // Ensure any field trials in browser are reflected into the child |
| // process. |
| +#if defined(OS_POSIX) && !defined(OS_NACL) && !defined(OS_MACOSX) && \ |
| + !defined(OS_ANDROID) |
|
Alexei Svitkine (slow)
2016/11/29 19:32:47
I think this can be simplified - this ifdef needs
lawrencewu
2016/11/29 19:52:44
I think this can even just be OS_POSIX.
|
| + // On POSIX systems that use the zygote, we get the trials from a shared |
| + // memory segment backed by an fd instead of the command line. |
| base::FieldTrialList::CreateTrialsFromCommandLine( |
| - command_line, switches::kFieldTrialHandle); |
| + command_line, switches::kFieldTrialHandle, kFieldTrialDescriptor); |
| +#else |
| + base::FieldTrialList::CreateTrialsFromCommandLine( |
| + command_line, switches::kFieldTrialHandle, -1); |
| +#endif |
| std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); |
| feature_list->InitializeFromCommandLine( |
| @@ -478,6 +486,10 @@ class ContentMainRunnerImpl : public ContentMainRunner { |
| SetupSignalHandlers(); |
| g_fds->Set(kMojoIPCChannel, |
| kMojoIPCChannel + base::GlobalDescriptors::kBaseDescriptor); |
| + |
| + g_fds->Set( |
| + kFieldTrialDescriptor, |
| + kFieldTrialDescriptor + base::GlobalDescriptors::kBaseDescriptor); |
| #endif // !OS_ANDROID |
| #if defined(OS_LINUX) || defined(OS_OPENBSD) |