summaryrefslogtreecommitdiffstats
path: root/chrome/browser/crash_handler_host_linux.h
diff options
context:
space:
mode:
authorIain Merrick <husky@google.com>2010-10-19 14:37:37 +0100
committerIain Merrick <husky@google.com>2010-10-19 14:37:37 +0100
commit3345a6884c488ff3a535c2c9acdd33d74b37e311 (patch)
tree7784b988ef1698cb6967ea1bdf07616237716c6c /chrome/browser/crash_handler_host_linux.h
parentefc8475837ec58186051f23bb03542620424f6ce (diff)
downloadexternal_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.zip
external_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.tar.gz
external_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.tar.bz2
Merge Chromium at 7.0.540.0 : Initial merge by git
Not including third_party/icu as it contains huge data files that break Gerrit, and aren't actually used. Change-Id: I428a386e70f3b58cacd28677b8cfda282e891e15
Diffstat (limited to 'chrome/browser/crash_handler_host_linux.h')
-rw-r--r--chrome/browser/crash_handler_host_linux.h52
1 files changed, 33 insertions, 19 deletions
diff --git a/chrome/browser/crash_handler_host_linux.h b/chrome/browser/crash_handler_host_linux.h
index 3f1ea2e..0e7bf6e 100644
--- a/chrome/browser/crash_handler_host_linux.h
+++ b/chrome/browser/crash_handler_host_linux.h
@@ -1,14 +1,20 @@
-// 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.
#ifndef CHROME_BROWSER_CRASH_HANDLER_HOST_LINUX_H_
#define CHROME_BROWSER_CRASH_HANDLER_HOST_LINUX_H_
+#pragma once
#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
@@ -38,18 +44,30 @@ class CrashHandlerHostLinux : public MessageLoopForIO::Watcher,
protected:
CrashHandlerHostLinux();
- ~CrashHandlerHostLinux();
- // This is here on purpose to make CrashHandlerHostLinux abstract.
- virtual void SetProcessType() = 0;
+ virtual ~CrashHandlerHostLinux();
+
+#if defined(USE_LINUX_BREAKPAD)
+ // Only called in concrete subclasses.
+ void InitCrashUploaderThread();
std::string process_type_;
+#endif
private:
void Init();
+#if defined(USE_LINUX_BREAKPAD)
+ // This is here on purpose to make CrashHandlerHostLinux abstract.
+ virtual void SetProcessType() = 0;
+#endif
+
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);
};
@@ -57,14 +75,12 @@ class CrashHandlerHostLinux : public MessageLoopForIO::Watcher,
class PluginCrashHandlerHostLinux : public CrashHandlerHostLinux {
private:
friend struct DefaultSingletonTraits<PluginCrashHandlerHostLinux>;
- PluginCrashHandlerHostLinux() {
- SetProcessType();
- }
- ~PluginCrashHandlerHostLinux() {}
+ PluginCrashHandlerHostLinux();
+ virtual ~PluginCrashHandlerHostLinux();
- virtual void SetProcessType() {
- process_type_ = "plugin";
- }
+#if defined(USE_LINUX_BREAKPAD)
+ virtual void SetProcessType();
+#endif
DISALLOW_COPY_AND_ASSIGN(PluginCrashHandlerHostLinux);
};
@@ -72,14 +88,12 @@ class PluginCrashHandlerHostLinux : public CrashHandlerHostLinux {
class RendererCrashHandlerHostLinux : public CrashHandlerHostLinux {
private:
friend struct DefaultSingletonTraits<RendererCrashHandlerHostLinux>;
- RendererCrashHandlerHostLinux() {
- SetProcessType();
- }
- ~RendererCrashHandlerHostLinux() {}
+ RendererCrashHandlerHostLinux();
+ virtual ~RendererCrashHandlerHostLinux();
- virtual void SetProcessType() {
- process_type_ = "renderer";
- }
+#if defined(USE_LINUX_BREAKPAD)
+ virtual void SetProcessType();
+#endif
DISALLOW_COPY_AND_ASSIGN(RendererCrashHandlerHostLinux);
};