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/child_process_launcher.h" | 5 #include "content/browser/child_process_launcher.h" |
6 | 6 |
7 #include <utility> // For std::pair. | 7 #include <utility> // For std::pair. |
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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
260 fds_to_map.push_back(std::make_pair( | 260 fds_to_map.push_back(std::make_pair( |
261 sandbox_fd, | 261 sandbox_fd, |
262 GetSandboxFD())); | 262 GetSandboxFD())); |
263 } | 263 } |
264 #endif // defined(OS_MACOSX) | 264 #endif // defined(OS_MACOSX) |
265 | 265 |
266 // Actually launch the app. | 266 // Actually launch the app. |
267 base::LaunchOptions options; | 267 base::LaunchOptions options; |
268 options.environ = env; | 268 options.environ = env; |
269 options.fds_to_remap = &fds_to_map; | 269 options.fds_to_remap = &fds_to_map; |
270 #if defined(OS_LINUX) | |
271 options.allow_new_privs = ZygoteHostImpl::GetInstance()-> | |
jln (very slow on Chromium)
2014/04/24 00:17:59
You are doing this for the GPU process aren't you?
| |
272 UsingSUIDSandbox(); | |
273 #endif | |
270 | 274 |
271 #if defined(OS_MACOSX) | 275 #if defined(OS_MACOSX) |
272 // Hold the MachBroker lock for the duration of LaunchProcess. The child | 276 // Hold the MachBroker lock for the duration of LaunchProcess. The child |
273 // will send its task port to the parent almost immediately after startup. | 277 // will send its task port to the parent almost immediately after startup. |
274 // The Mach message will be delivered to the parent, but updating the | 278 // The Mach message will be delivered to the parent, but updating the |
275 // record of the launch will wait until after the placeholder PID is | 279 // record of the launch will wait until after the placeholder PID is |
276 // inserted below. This ensures that while the child process may send its | 280 // inserted below. This ensures that while the child process may send its |
277 // port to the parent prior to the parent leaving LaunchProcess, the | 281 // port to the parent prior to the parent leaving LaunchProcess, the |
278 // order in which the record in MachBroker is updated is correct. | 282 // order in which the record in MachBroker is updated is correct. |
279 MachBroker* broker = MachBroker::GetInstance(); | 283 MachBroker* broker = MachBroker::GetInstance(); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
502 GetHandle(), background)); | 506 GetHandle(), background)); |
503 } | 507 } |
504 | 508 |
505 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 509 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
506 bool terminate_on_shutdown) { | 510 bool terminate_on_shutdown) { |
507 if (context_.get()) | 511 if (context_.get()) |
508 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 512 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
509 } | 513 } |
510 | 514 |
511 } // namespace content | 515 } // namespace content |
OLD | NEW |