OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/child_process_launcher.h" | 5 #include "content/browser/child_process_launcher.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 // Make sure the MachBroker is running, and inform it to expect a | 241 // Make sure the MachBroker is running, and inform it to expect a |
242 // check-in from the new process. | 242 // check-in from the new process. |
243 broker->EnsureRunning(); | 243 broker->EnsureRunning(); |
244 | 244 |
245 const SandboxType sandbox_type = delegate->GetSandboxType(); | 245 const SandboxType sandbox_type = delegate->GetSandboxType(); |
246 scoped_ptr<sandbox::PreExecDelegate> pre_exec_delegate; | 246 scoped_ptr<sandbox::PreExecDelegate> pre_exec_delegate; |
247 if (BootstrapSandboxManager::ShouldEnable()) { | 247 if (BootstrapSandboxManager::ShouldEnable()) { |
248 BootstrapSandboxManager* sandbox_manager = | 248 BootstrapSandboxManager* sandbox_manager = |
249 BootstrapSandboxManager::GetInstance(); | 249 BootstrapSandboxManager::GetInstance(); |
250 if (sandbox_manager->EnabledForSandbox(sandbox_type)) { | 250 if (sandbox_manager->EnabledForSandbox(sandbox_type)) { |
251 pre_exec_delegate = | 251 pre_exec_delegate = sandbox_manager->sandbox()->NewClient(sandbox_type); |
252 sandbox_manager->sandbox()->NewClient(sandbox_type).Pass(); | |
253 } | 252 } |
254 } | 253 } |
255 options.pre_exec_delegate = pre_exec_delegate.get(); | 254 options.pre_exec_delegate = pre_exec_delegate.get(); |
256 #endif // defined(OS_MACOSX) | 255 #endif // defined(OS_MACOSX) |
257 | 256 |
258 process = base::LaunchProcess(*cmd_line, options); | 257 process = base::LaunchProcess(*cmd_line, options); |
259 | 258 |
260 #if defined(OS_MACOSX) | 259 #if defined(OS_MACOSX) |
261 if (process.IsValid()) { | 260 if (process.IsValid()) { |
262 broker->AddPlaceholderForPid(process.Pid(), child_process_id); | 261 broker->AddPlaceholderForPid(process.Pid(), child_process_id); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 } | 520 } |
522 | 521 |
523 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( | 522 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( |
524 Client* client) { | 523 Client* client) { |
525 Client* ret = client_; | 524 Client* ret = client_; |
526 client_ = client; | 525 client_ = client; |
527 return ret; | 526 return ret; |
528 } | 527 } |
529 | 528 |
530 } // namespace content | 529 } // namespace content |
OLD | NEW |