| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 cmd_line->GetSwitchValueASCII(switches::kProcessType); | 120 cmd_line->GetSwitchValueASCII(switches::kProcessType); |
| 121 int crash_signal_fd = | 121 int crash_signal_fd = |
| 122 content::GetContentClient()->browser()->GetCrashSignalFD(process_type); | 122 content::GetContentClient()->browser()->GetCrashSignalFD(process_type); |
| 123 if (use_zygote) { | 123 if (use_zygote) { |
| 124 base::GlobalDescriptors::Mapping mapping; | 124 base::GlobalDescriptors::Mapping mapping; |
| 125 mapping.push_back(std::pair<uint32_t, int>(kPrimaryIPCChannel, ipcfd)); | 125 mapping.push_back(std::pair<uint32_t, int>(kPrimaryIPCChannel, ipcfd)); |
| 126 if (crash_signal_fd >= 0) { | 126 if (crash_signal_fd >= 0) { |
| 127 mapping.push_back(std::pair<uint32_t, int>(kCrashDumpSignal, | 127 mapping.push_back(std::pair<uint32_t, int>(kCrashDumpSignal, |
| 128 crash_signal_fd)); | 128 crash_signal_fd)); |
| 129 } | 129 } |
| 130 handle = ZygoteHost::GetInstance()->ForkRenderer(cmd_line->argv(), | 130 handle = ZygoteHost::GetInstance()->ForkRequest(cmd_line->argv(), |
| 131 mapping); | 131 mapping, |
| 132 process_type); |
| 132 } else | 133 } else |
| 133 // Fall through to the normal posix case below when we're not zygoting. | 134 // Fall through to the normal posix case below when we're not zygoting. |
| 134 #endif | 135 #endif |
| 135 { | 136 { |
| 136 base::file_handle_mapping_vector fds_to_map; | 137 base::file_handle_mapping_vector fds_to_map; |
| 137 fds_to_map.push_back(std::make_pair( | 138 fds_to_map.push_back(std::make_pair( |
| 138 ipcfd, | 139 ipcfd, |
| 139 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor)); | 140 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor)); |
| 140 | 141 |
| 141 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 142 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 context_.get(), | 368 context_.get(), |
| 368 &ChildProcessLauncher::Context::SetProcessBackgrounded, | 369 &ChildProcessLauncher::Context::SetProcessBackgrounded, |
| 369 background)); | 370 background)); |
| 370 } | 371 } |
| 371 | 372 |
| 372 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 373 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
| 373 bool terminate_on_shutdown) { | 374 bool terminate_on_shutdown) { |
| 374 if (context_) | 375 if (context_) |
| 375 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 376 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
| 376 } | 377 } |
| 377 | |
| OLD | NEW |