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()->ForkRequest(cmd_line->argv(), | 130 handle = ZygoteHost::GetInstance()->ForkRenderer(cmd_line->argv(), |
131 mapping, | 131 mapping); |
132 process_type); | |
133 } else | 132 } else |
134 // Fall through to the normal posix case below when we're not zygoting. | 133 // Fall through to the normal posix case below when we're not zygoting. |
135 #endif | 134 #endif |
136 { | 135 { |
137 base::file_handle_mapping_vector fds_to_map; | 136 base::file_handle_mapping_vector fds_to_map; |
138 fds_to_map.push_back(std::make_pair( | 137 fds_to_map.push_back(std::make_pair( |
139 ipcfd, | 138 ipcfd, |
140 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor)); | 139 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor)); |
141 | 140 |
142 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 141 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 context_.get(), | 367 context_.get(), |
369 &ChildProcessLauncher::Context::SetProcessBackgrounded, | 368 &ChildProcessLauncher::Context::SetProcessBackgrounded, |
370 background)); | 369 background)); |
371 } | 370 } |
372 | 371 |
373 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 372 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
374 bool terminate_on_shutdown) { | 373 bool terminate_on_shutdown) { |
375 if (context_) | 374 if (context_) |
376 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 375 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
377 } | 376 } |
| 377 |
OLD | NEW |