summaryrefslogtreecommitdiffstats
path: root/chrome/browser/crash_handler_host_linux.h
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-02 23:53:26 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-02 23:53:26 +0000
commitb064f0ebd408d4ef852052963ff443e1fd3f261c (patch)
treebc20af203d3ca422734fb52ae083967c1864c645 /chrome/browser/crash_handler_host_linux.h
parente51cb6f8bcdec373ccabd5ea609bc7855eb6c070 (diff)
downloadchromium_src-b064f0ebd408d4ef852052963ff443e1fd3f261c.zip
chromium_src-b064f0ebd408d4ef852052963ff443e1fd3f261c.tar.gz
chromium_src-b064f0ebd408d4ef852052963ff443e1fd3f261c.tar.bz2
Linux: Handle renderer and plugin crashes on a separate thread. (try 2)
Also set retries / timeouts for wget to attempt to limit the duration of each crash handler. Move some code out of headers while we're at it. BUG=54071 TEST=change /usr/bin/wget to sleep forever, visit about:crash in a Breakpad-enabled build, make sure other renderers continue to work. Original Review URL: http://codereview.chromium.org/3308007 Review URL: http://codereview.chromium.org/3333012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58431 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/crash_handler_host_linux.h')
-rw-r--r--chrome/browser/crash_handler_host_linux.h38
1 files changed, 22 insertions, 16 deletions
diff --git a/chrome/browser/crash_handler_host_linux.h b/chrome/browser/crash_handler_host_linux.h
index 625ac8e..a31300c 100644
--- a/chrome/browser/crash_handler_host_linux.h
+++ b/chrome/browser/crash_handler_host_linux.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,8 +8,13 @@
#include <string>
-#include "base/singleton.h"
#include "base/message_loop.h"
+#include "base/scoped_ptr.h"
+#include "base/singleton.h"
+
+namespace base {
+class Thread;
+}
// This is the base class for singleton objects which crash dump renderers and
// plugins on Linux. We perform the crash dump from the browser because it
@@ -40,17 +45,22 @@ class CrashHandlerHostLinux : public MessageLoopForIO::Watcher,
protected:
CrashHandlerHostLinux();
virtual ~CrashHandlerHostLinux();
+#if defined(USE_LINUX_BREAKPAD)
// This is here on purpose to make CrashHandlerHostLinux abstract.
virtual void SetProcessType() = 0;
std::string process_type_;
+#endif
private:
void Init();
int process_socket_;
int browser_socket_;
+#if defined(USE_LINUX_BREAKPAD)
MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_;
+ scoped_ptr<base::Thread> uploader_thread_;
+#endif
DISALLOW_COPY_AND_ASSIGN(CrashHandlerHostLinux);
};
@@ -58,14 +68,12 @@ class CrashHandlerHostLinux : public MessageLoopForIO::Watcher,
class PluginCrashHandlerHostLinux : public CrashHandlerHostLinux {
private:
friend struct DefaultSingletonTraits<PluginCrashHandlerHostLinux>;
- PluginCrashHandlerHostLinux() {
- SetProcessType();
- }
- virtual ~PluginCrashHandlerHostLinux() {}
+ PluginCrashHandlerHostLinux();
+ virtual ~PluginCrashHandlerHostLinux();
- virtual void SetProcessType() {
- process_type_ = "plugin";
- }
+#if defined(USE_LINUX_BREAKPAD)
+ virtual void SetProcessType();
+#endif
DISALLOW_COPY_AND_ASSIGN(PluginCrashHandlerHostLinux);
};
@@ -73,14 +81,12 @@ class PluginCrashHandlerHostLinux : public CrashHandlerHostLinux {
class RendererCrashHandlerHostLinux : public CrashHandlerHostLinux {
private:
friend struct DefaultSingletonTraits<RendererCrashHandlerHostLinux>;
- RendererCrashHandlerHostLinux() {
- SetProcessType();
- }
- virtual ~RendererCrashHandlerHostLinux() {}
+ RendererCrashHandlerHostLinux();
+ virtual ~RendererCrashHandlerHostLinux();
- virtual void SetProcessType() {
- process_type_ = "renderer";
- }
+#if defined(USE_LINUX_BREAKPAD)
+ virtual void SetProcessType();
+#endif
DISALLOW_COPY_AND_ASSIGN(RendererCrashHandlerHostLinux);
};