| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/browser_child_process_host_impl.h" | 5 #include "content/browser/browser_child_process_host_impl.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/dump_without_crashing.h" | 10 #include "base/debug/dump_without_crashing.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 BrowserChildProcessList copy = g_child_process_list.Get(); | 212 BrowserChildProcessList copy = g_child_process_list.Get(); |
| 213 for (BrowserChildProcessList::iterator it = copy.begin(); | 213 for (BrowserChildProcessList::iterator it = copy.begin(); |
| 214 it != copy.end(); ++it) { | 214 it != copy.end(); ++it) { |
| 215 delete (*it)->delegate(); // ~*HostDelegate deletes *HostImpl. | 215 delete (*it)->delegate(); // ~*HostDelegate deletes *HostImpl. |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 | 218 |
| 219 // static | 219 // static |
| 220 void BrowserChildProcessHostImpl::CopyFeatureAndFieldTrialFlags( | 220 void BrowserChildProcessHostImpl::CopyFeatureAndFieldTrialFlags( |
| 221 base::CommandLine* cmd_line) { | 221 base::CommandLine* cmd_line) { |
| 222 std::string enabled_features; | |
| 223 std::string disabled_features; | |
| 224 base::FeatureList::GetInstance()->GetFeatureOverrides(&enabled_features, | |
| 225 &disabled_features); | |
| 226 if (!enabled_features.empty()) | |
| 227 cmd_line->AppendSwitchASCII(switches::kEnableFeatures, enabled_features); | |
| 228 if (!disabled_features.empty()) | |
| 229 cmd_line->AppendSwitchASCII(switches::kDisableFeatures, disabled_features); | |
| 230 | |
| 231 // If we run base::FieldTrials, we want to pass to their state to the | 222 // If we run base::FieldTrials, we want to pass to their state to the |
| 232 // child process so that it can act in accordance with each state. | 223 // child process so that it can act in accordance with each state. |
| 233 base::FieldTrialList::CopyFieldTrialStateToFlags(switches::kFieldTrialHandle, | 224 base::FieldTrialList::CopyFieldTrialStateToFlags( |
| 234 cmd_line); | 225 switches::kFieldTrialHandle, switches::kEnableFeatures, |
| 226 switches::kDisableFeatures, cmd_line); |
| 235 } | 227 } |
| 236 | 228 |
| 237 void BrowserChildProcessHostImpl::Launch( | 229 void BrowserChildProcessHostImpl::Launch( |
| 238 SandboxedProcessLauncherDelegate* delegate, | 230 SandboxedProcessLauncherDelegate* delegate, |
| 239 base::CommandLine* cmd_line, | 231 base::CommandLine* cmd_line, |
| 240 bool terminate_on_shutdown) { | 232 bool terminate_on_shutdown) { |
| 241 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 233 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 242 | 234 |
| 243 GetContentClient()->browser()->AppendExtraCommandLineSwitches( | 235 GetContentClient()->browser()->AppendExtraCommandLineSwitches( |
| 244 cmd_line, data_.id); | 236 cmd_line, data_.id); |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 | 598 |
| 607 #if defined(OS_WIN) | 599 #if defined(OS_WIN) |
| 608 | 600 |
| 609 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { | 601 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { |
| 610 OnChildDisconnected(); | 602 OnChildDisconnected(); |
| 611 } | 603 } |
| 612 | 604 |
| 613 #endif | 605 #endif |
| 614 | 606 |
| 615 } // namespace content | 607 } // namespace content |
| OLD | NEW |