Chromium Code Reviews| Index: content/browser/renderer_host/render_process_host_impl.cc |
| diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc |
| index 00f88e99958af2563e24f2a1e09c9d1f1b39263c..27036fac22aa1b1e81018e064b28dcd135bccad9 100644 |
| --- a/content/browser/renderer_host/render_process_host_impl.cc |
| +++ b/content/browser/renderer_host/render_process_host_impl.cc |
| @@ -968,7 +968,7 @@ bool RenderProcessHostImpl::Init() { |
| // at this stage. |
| child_process_launcher_.reset(new ChildProcessLauncher( |
| new RendererSandboxedProcessLauncherDelegate(channel_.get()), cmd_line, |
| - GetID(), this, child_token_, |
| + GetID(), this, field_trial_state_.get(), child_token_, |
| base::Bind(&RenderProcessHostImpl::OnMojoError, |
| weak_factory_.GetWeakPtr(), |
| base::ThreadTaskRunnerHandle::Get()))); |
| @@ -1587,7 +1587,7 @@ static void AppendCompositorCommandLineFlags(base::CommandLine* command_line) { |
| } |
| void RenderProcessHostImpl::AppendRendererCommandLine( |
| - base::CommandLine* command_line) const { |
| + base::CommandLine* command_line) { |
| // Pass the process type first, so it shows first in process listings. |
| command_line->AppendSwitchASCII(switches::kProcessType, |
| switches::kRendererProcess); |
| @@ -1626,7 +1626,7 @@ void RenderProcessHostImpl::AppendRendererCommandLine( |
| void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( |
| const base::CommandLine& browser_cmd, |
| - base::CommandLine* renderer_cmd) const { |
| + base::CommandLine* renderer_cmd) { |
| // Propagate the following switches to the renderer command line (along |
| // with any associated values) if present in the browser command line. |
| static const char* const kSwitchNames[] = { |
| @@ -1839,7 +1839,17 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( |
| renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames, |
| arraysize(kSwitchNames)); |
| - BrowserChildProcessHostImpl::CopyFeatureAndFieldTrialFlags(renderer_cmd); |
| +#if defined(OS_WIN) |
| + if (base::FeatureList::IsEnabled( |
| + features::kShareFieldTrialStateViaSharedMemory)) |
| + field_trial_state_.reset(new base::SharedMemory()); |
|
Alexei Svitkine (slow)
2016/10/04 18:49:36
I don't like duplicating this code - especially si
lawrencewu
2016/10/05 20:57:56
Done.
|
| +#endif |
| + BrowserChildProcessHostImpl::CopyFeatureAndFieldTrialFlags( |
| + renderer_cmd, field_trial_state_.get()); |
| +#if defined(OS_WIN) |
| + if (!field_trial_state_.get()->handle().GetHandle()) |
| + field_trial_state_.reset(); |
| +#endif |
| if (browser_cmd.HasSwitch(switches::kTraceStartup) && |
| BrowserMainLoop::GetInstance()->is_tracing_startup_for_duration()) { |