summaryrefslogtreecommitdiffstats
path: root/chrome/app
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-09 04:21:51 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-09 04:21:51 +0000
commit2456c5732fe85109c39dbdd3dbbb8262589a847e (patch)
tree2c80c90ee30afb95428903c267e0eebe028d73f5 /chrome/app
parent22dac03746590ef7367c8af21ace424b77cae16d (diff)
downloadchromium_src-2456c5732fe85109c39dbdd3dbbb8262589a847e.zip
chromium_src-2456c5732fe85109c39dbdd3dbbb8262589a847e.tar.gz
chromium_src-2456c5732fe85109c39dbdd3dbbb8262589a847e.tar.bz2
Linux: Catch plugin crashes.
BUG=25964 TEST=none Review URL: http://codereview.chromium.org/371015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app')
-rw-r--r--chrome/app/breakpad_linux.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/chrome/app/breakpad_linux.cc b/chrome/app/breakpad_linux.cc
index fe47108..ba9edbf 100644
--- a/chrome/app/breakpad_linux.cc
+++ b/chrome/app/breakpad_linux.cc
@@ -450,8 +450,8 @@ pid_t HandleCrashDump(const BreakpadInfo& info) {
const pid_t child = sys_fork();
if (!child) {
// This code is called both when a browser is crashing (in which case,
- // nothing really matters any more) and when a renderer crashes, in which
- // case we need to continue.
+ // nothing really matters any more) and when a renderer/plugin crashes, in
+ // which case we need to continue.
//
// Since we are a multithreaded app, if we were just to fork(), we might
// grab file descriptors which have just been created in another thread and
@@ -608,9 +608,10 @@ namespace child_process_logging {
extern std::string active_url;
}
+// Currently Non-Browser = Renderer and Plugins
static bool
-RendererCrashHandler(const void* crash_context, size_t crash_context_size,
- void* context) {
+NonBrowserCrashHandler(const void* crash_context, size_t crash_context_size,
+ void* context) {
const int fd = reinterpret_cast<intptr_t>(context);
int fds[2];
socketpair(AF_UNIX, SOCK_STREAM, 0, fds);
@@ -664,13 +665,13 @@ RendererCrashHandler(const void* crash_context, size_t crash_context_size,
return true;
}
-void EnableRendererCrashDumping() {
+void EnableNonBrowserCrashDumping() {
const int fd = Singleton<base::GlobalDescriptors>()->Get(kCrashDumpSignal);
// We deliberately leak this object.
google_breakpad::ExceptionHandler* handler =
new google_breakpad::ExceptionHandler("" /* unused */, NULL, NULL,
(void*) fd, true);
- handler->set_crash_handler(RendererCrashHandler);
+ handler->set_crash_handler(NonBrowserCrashHandler);
}
void InitCrashReporter() {
@@ -684,10 +685,13 @@ void InitCrashReporter() {
return;
EnableCrashDumping(unattended);
} else if (process_type == switches::kRendererProcess ||
+ process_type == switches::kPluginProcess ||
process_type == switches::kZygoteProcess) {
// We might be chrooted in a zygote or renderer process so we cannot call
// GetCollectStatsConsent because that needs access the the user's home
// dir. Instead, we set a command line flag for these processes.
+ // Even though plugins are not chrooted, we share the same code path for
+ // simplicity.
if (!parsed_command_line.HasSwitch(switches::kEnableCrashReporter))
return;
// Get the guid and linux distro from the command line switch.
@@ -700,7 +704,7 @@ void InitCrashReporter() {
} else {
google_update::posix_guid = switch_value;
}
- EnableRendererCrashDumping();
+ EnableNonBrowserCrashDumping();
}
// Set the base process uptime value.