OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/child_process_launcher.h" | 5 #include "chrome/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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 133 |
134 #if defined(OS_LINUX) | 134 #if defined(OS_LINUX) |
135 // On Linux, we need to add some extra file descriptors for crash handling | 135 // On Linux, we need to add some extra file descriptors for crash handling |
136 // and the sandbox. | 136 // and the sandbox. |
137 bool is_renderer = | 137 bool is_renderer = |
138 cmd_line->GetSwitchValueASCII(switches::kProcessType) == | 138 cmd_line->GetSwitchValueASCII(switches::kProcessType) == |
139 switches::kRendererProcess; | 139 switches::kRendererProcess; |
140 bool is_plugin = | 140 bool is_plugin = |
141 cmd_line->GetSwitchValueASCII(switches::kProcessType) == | 141 cmd_line->GetSwitchValueASCII(switches::kProcessType) == |
142 switches::kPluginProcess; | 142 switches::kPluginProcess; |
| 143 bool is_gpu = |
| 144 cmd_line->GetSwitchValueASCII(switches::kProcessType) == |
| 145 switches::kGpuProcess; |
143 | 146 |
144 if (is_renderer || is_plugin) { | 147 if (is_renderer || is_plugin || is_gpu) { |
145 int crash_signal_fd; | 148 int crash_signal_fd; |
146 if (is_renderer) { | 149 if (is_renderer) { |
147 crash_signal_fd = RendererCrashHandlerHostLinux::GetInstance()-> | 150 crash_signal_fd = RendererCrashHandlerHostLinux::GetInstance()-> |
148 GetDeathSignalSocket(); | 151 GetDeathSignalSocket(); |
| 152 } else if (is_plugin) { |
| 153 crash_signal_fd = PluginCrashHandlerHostLinux::GetInstance()-> |
| 154 GetDeathSignalSocket(); |
149 } else { | 155 } else { |
150 crash_signal_fd = PluginCrashHandlerHostLinux::GetInstance()-> | 156 crash_signal_fd = GpuCrashHandlerHostLinux::GetInstance()-> |
151 GetDeathSignalSocket(); | 157 GetDeathSignalSocket(); |
152 } | 158 } |
153 if (crash_signal_fd >= 0) { | 159 if (crash_signal_fd >= 0) { |
154 fds_to_map.push_back(std::make_pair( | 160 fds_to_map.push_back(std::make_pair( |
155 crash_signal_fd, | 161 crash_signal_fd, |
156 kCrashDumpSignal + base::GlobalDescriptors::kBaseDescriptor)); | 162 kCrashDumpSignal + base::GlobalDescriptors::kBaseDescriptor)); |
157 } | 163 } |
158 } | 164 } |
159 if (is_renderer) { | 165 if (is_renderer) { |
160 const int sandbox_fd = | 166 const int sandbox_fd = |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 if (status != base::TERMINATION_STATUS_STILL_RUNNING) | 339 if (status != base::TERMINATION_STATUS_STILL_RUNNING) |
334 context_->process_.Close(); | 340 context_->process_.Close(); |
335 | 341 |
336 return status; | 342 return status; |
337 } | 343 } |
338 | 344 |
339 void ChildProcessLauncher::SetProcessBackgrounded(bool background) { | 345 void ChildProcessLauncher::SetProcessBackgrounded(bool background) { |
340 DCHECK(!context_->starting_); | 346 DCHECK(!context_->starting_); |
341 context_->process_.SetProcessBackgrounded(background); | 347 context_->process_.SetProcessBackgrounded(background); |
342 } | 348 } |
OLD | NEW |