summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-15 22:05:29 +0000
committerpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-15 22:05:29 +0000
commit54457f38c36e43d9f5d434e5bfc3cb83d9e56926 (patch)
treeaa82f84163493b674038c9e3752d00f605b9ad38 /content
parenta1a9e7c87641ad88d189c154293bf602859249f3 (diff)
downloadchromium_src-54457f38c36e43d9f5d434e5bfc3cb83d9e56926.zip
chromium_src-54457f38c36e43d9f5d434e5bfc3cb83d9e56926.tar.gz
chromium_src-54457f38c36e43d9f5d434e5bfc3cb83d9e56926.tar.bz2
Fix crash reporting for ppapi
BUG=chromium-os:13952 TEST=run chrome with CHROME_HEADLESS=1 and pepper flash, kill -11 the ppapi process, check that a report gets written to disk Review URL: http://codereview.chromium.org/6864005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81813 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/child_process_launcher.cc57
-rw-r--r--content/browser/ppapi_plugin_process_host.cc2
2 files changed, 28 insertions, 31 deletions
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc
index af4c797..49d8221 100644
--- a/content/browser/child_process_launcher.cc
+++ b/content/browser/child_process_launcher.cc
@@ -111,11 +111,31 @@ class ChildProcessLauncher::Context
#elif defined(OS_POSIX)
#if defined(OS_LINUX)
+ // On Linux, we need to add some extra file descriptors for crash handling.
+ std::string process_type =
+ cmd_line->GetSwitchValueASCII(switches::kProcessType);
+ bool is_renderer = process_type == switches::kRendererProcess;
+ bool is_plugin = process_type == switches::kPluginProcess;
+ bool is_ppapi = process_type == switches::kPpapiPluginProcess;
+ bool is_gpu = process_type == switches::kGpuProcess;
+ int crash_signal_fd = -1;
+ if (is_renderer) {
+ crash_signal_fd =
+ RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket();
+ } else if (is_plugin) {
+ crash_signal_fd =
+ PluginCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket();
+ } else if (is_ppapi) {
+ crash_signal_fd =
+ PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket();
+ } else if (is_gpu) {
+ crash_signal_fd =
+ GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket();
+ }
+
if (use_zygote) {
base::GlobalDescriptors::Mapping mapping;
mapping.push_back(std::pair<uint32_t, int>(kPrimaryIPCChannel, ipcfd));
- const int crash_signal_fd =
- RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket();
if (crash_signal_fd >= 0) {
mapping.push_back(std::pair<uint32_t, int>(kCrashDumpSignal,
crash_signal_fd));
@@ -132,35 +152,10 @@ class ChildProcessLauncher::Context
kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor));
#if defined(OS_LINUX)
- // On Linux, we need to add some extra file descriptors for crash handling
- // and the sandbox.
- bool is_renderer =
- cmd_line->GetSwitchValueASCII(switches::kProcessType) ==
- switches::kRendererProcess;
- bool is_plugin =
- cmd_line->GetSwitchValueASCII(switches::kProcessType) ==
- switches::kPluginProcess;
- bool is_gpu =
- cmd_line->GetSwitchValueASCII(switches::kProcessType) ==
- switches::kGpuProcess;
-
- if (is_renderer || is_plugin || is_gpu) {
- int crash_signal_fd;
- if (is_renderer) {
- crash_signal_fd = RendererCrashHandlerHostLinux::GetInstance()->
- GetDeathSignalSocket();
- } else if (is_plugin) {
- crash_signal_fd = PluginCrashHandlerHostLinux::GetInstance()->
- GetDeathSignalSocket();
- } else {
- crash_signal_fd = GpuCrashHandlerHostLinux::GetInstance()->
- GetDeathSignalSocket();
- }
- if (crash_signal_fd >= 0) {
- fds_to_map.push_back(std::make_pair(
- crash_signal_fd,
- kCrashDumpSignal + base::GlobalDescriptors::kBaseDescriptor));
- }
+ if (crash_signal_fd >= 0) {
+ fds_to_map.push_back(std::make_pair(
+ crash_signal_fd,
+ kCrashDumpSignal + base::GlobalDescriptors::kBaseDescriptor));
}
if (is_renderer) {
const int sandbox_fd =
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
index 598f6fe..a19e57a 100644
--- a/content/browser/ppapi_plugin_process_host.cc
+++ b/content/browser/ppapi_plugin_process_host.cc
@@ -45,6 +45,8 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) {
switches::kPpapiPluginProcess);
cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id());
+ SetCrashReporterCommandLine(cmd_line);
+
if (!plugin_launcher.empty())
cmd_line->PrependWrapper(plugin_launcher);