Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3894)

Unified Diff: chrome/browser/crash_handler_host_posix.h

Issue 9838033: Upstream native crash handling changes for Android. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: In response to comments. Lots of linux to posix Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/crash_handler_host_posix.h
diff --git a/chrome/browser/crash_handler_host_linux.h b/chrome/browser/crash_handler_host_posix.h
similarity index 53%
rename from chrome/browser/crash_handler_host_linux.h
rename to chrome/browser/crash_handler_host_posix.h
index 55ef624ee3d5706aa4cc923fe638ec9f1bf6eb65..d2870418496791baaf983ac8c09c6bd7810c4577 100644
--- a/chrome/browser/crash_handler_host_linux.h
+++ b/chrome/browser/crash_handler_host_posix.h
@@ -2,14 +2,14 @@
// 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_
+#ifndef CHROME_BROWSER_CRASH_HANDLER_HOST_POSIX_H_
+#define CHROME_BROWSER_CRASH_HANDLER_HOST_POSIX_H_
#pragma once
#include "base/compiler_specific.h"
#include "base/message_loop.h"
-#if defined(USE_LINUX_BREAKPAD)
+#if defined(USE_POSIX_BREAKPAD)
#include <sys/types.h>
#include <string>
@@ -21,21 +21,21 @@ class BreakpadInfo;
namespace base {
class Thread;
}
-#endif // defined(USE_LINUX_BREAKPAD)
+#endif // defined(USE_POSIX_BREAKPAD)
template <typename T> struct DefaultSingletonTraits;
// 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
-// allows us to be outside the sandbox.
+// plugins on Linux or Android. We perform the crash dump from the browser
+// because it allows us to be outside the sandbox.
//
-// PluginCrashHandlerHostLinux and RendererCrashHandlerHostLinux are singletons
+// PluginCrashHandlerHostPosix and RendererCrashHandlerHostPosix are singletons
// that handle plugin and renderer crashes, respectively.
//
// Processes signal that they need to be dumped by sending a datagram over a
// UNIX domain socket. All processes of the same type share the client end of
// this socket which is installed in their descriptor table before exec.
-class CrashHandlerHostLinux : public MessageLoopForIO::Watcher,
+class CrashHandlerHostPosix : public MessageLoopForIO::Watcher,
public MessageLoop::DestructionObserver {
public:
// Get the file descriptor which processes should be given in order to signal
@@ -51,16 +51,16 @@ class CrashHandlerHostLinux : public MessageLoopForIO::Watcher,
// MessageLoop::DestructionObserver impl:
virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
-#if defined(USE_LINUX_BREAKPAD)
+#if defined(USE_POSIX_BREAKPAD)
// Whether we are shutting down or not.
bool IsShuttingDown() const;
#endif
protected:
- CrashHandlerHostLinux();
- virtual ~CrashHandlerHostLinux();
+ CrashHandlerHostPosix();
+ virtual ~CrashHandlerHostPosix();
-#if defined(USE_LINUX_BREAKPAD)
+#if defined(USE_POSIX_BREAKPAD)
// Only called in concrete subclasses.
void InitCrashUploaderThread();
@@ -70,8 +70,8 @@ class CrashHandlerHostLinux : public MessageLoopForIO::Watcher,
private:
void Init();
-#if defined(USE_LINUX_BREAKPAD)
- // This is here on purpose to make CrashHandlerHostLinux abstract.
+#if defined(USE_POSIX_BREAKPAD)
+ // This is here on purpose to make CrashHandlerHostPosix abstract.
virtual void SetProcessType() = 0;
// Do work on the FILE thread for OnFileCanReadWithoutBlocking().
@@ -87,98 +87,98 @@ class CrashHandlerHostLinux : public MessageLoopForIO::Watcher,
int process_socket_;
int browser_socket_;
-#if defined(USE_LINUX_BREAKPAD)
+#if defined(USE_POSIX_BREAKPAD)
MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_;
scoped_ptr<base::Thread> uploader_thread_;
bool shutting_down_;
#endif
- DISALLOW_COPY_AND_ASSIGN(CrashHandlerHostLinux);
+ DISALLOW_COPY_AND_ASSIGN(CrashHandlerHostPosix);
};
-class ExtensionCrashHandlerHostLinux : public CrashHandlerHostLinux {
+class ExtensionCrashHandlerHostPosix : public CrashHandlerHostPosix {
public:
// Returns the singleton instance.
- static ExtensionCrashHandlerHostLinux* GetInstance();
+ static ExtensionCrashHandlerHostPosix* GetInstance();
private:
- friend struct DefaultSingletonTraits<ExtensionCrashHandlerHostLinux>;
- ExtensionCrashHandlerHostLinux();
- virtual ~ExtensionCrashHandlerHostLinux();
+ friend struct DefaultSingletonTraits<ExtensionCrashHandlerHostPosix>;
+ ExtensionCrashHandlerHostPosix();
+ virtual ~ExtensionCrashHandlerHostPosix();
-#if defined(USE_LINUX_BREAKPAD)
+#if defined(USE_POSIX_BREAKPAD)
virtual void SetProcessType() OVERRIDE;
#endif
- DISALLOW_COPY_AND_ASSIGN(ExtensionCrashHandlerHostLinux);
+ DISALLOW_COPY_AND_ASSIGN(ExtensionCrashHandlerHostPosix);
};
-class GpuCrashHandlerHostLinux : public CrashHandlerHostLinux {
+class GpuCrashHandlerHostPosix : public CrashHandlerHostPosix {
public:
// Returns the singleton instance.
- static GpuCrashHandlerHostLinux* GetInstance();
+ static GpuCrashHandlerHostPosix* GetInstance();
private:
- friend struct DefaultSingletonTraits<GpuCrashHandlerHostLinux>;
- GpuCrashHandlerHostLinux();
- virtual ~GpuCrashHandlerHostLinux();
+ friend struct DefaultSingletonTraits<GpuCrashHandlerHostPosix>;
+ GpuCrashHandlerHostPosix();
+ virtual ~GpuCrashHandlerHostPosix();
-#if defined(USE_LINUX_BREAKPAD)
+#if defined(USE_POSIX_BREAKPAD)
virtual void SetProcessType() OVERRIDE;
#endif
- DISALLOW_COPY_AND_ASSIGN(GpuCrashHandlerHostLinux);
+ DISALLOW_COPY_AND_ASSIGN(GpuCrashHandlerHostPosix);
};
-class PluginCrashHandlerHostLinux : public CrashHandlerHostLinux {
+class PluginCrashHandlerHostPosix : public CrashHandlerHostPosix {
public:
// Returns the singleton instance.
- static PluginCrashHandlerHostLinux* GetInstance();
+ static PluginCrashHandlerHostPosix* GetInstance();
private:
- friend struct DefaultSingletonTraits<PluginCrashHandlerHostLinux>;
- PluginCrashHandlerHostLinux();
- virtual ~PluginCrashHandlerHostLinux();
+ friend struct DefaultSingletonTraits<PluginCrashHandlerHostPosix>;
+ PluginCrashHandlerHostPosix();
+ virtual ~PluginCrashHandlerHostPosix();
-#if defined(USE_LINUX_BREAKPAD)
+#if defined(USE_POSIX_BREAKPAD)
virtual void SetProcessType() OVERRIDE;
#endif
- DISALLOW_COPY_AND_ASSIGN(PluginCrashHandlerHostLinux);
+ DISALLOW_COPY_AND_ASSIGN(PluginCrashHandlerHostPosix);
};
-class PpapiCrashHandlerHostLinux : public CrashHandlerHostLinux {
+class PpapiCrashHandlerHostPosix : public CrashHandlerHostPosix {
public:
// Returns the singleton instance.
- static PpapiCrashHandlerHostLinux* GetInstance();
+ static PpapiCrashHandlerHostPosix* GetInstance();
private:
- friend struct DefaultSingletonTraits<PpapiCrashHandlerHostLinux>;
- PpapiCrashHandlerHostLinux();
- virtual ~PpapiCrashHandlerHostLinux();
+ friend struct DefaultSingletonTraits<PpapiCrashHandlerHostPosix>;
+ PpapiCrashHandlerHostPosix();
+ virtual ~PpapiCrashHandlerHostPosix();
-#if defined(USE_LINUX_BREAKPAD)
+#if defined(USE_POSIX_BREAKPAD)
virtual void SetProcessType() OVERRIDE;
#endif
- DISALLOW_COPY_AND_ASSIGN(PpapiCrashHandlerHostLinux);
+ DISALLOW_COPY_AND_ASSIGN(PpapiCrashHandlerHostPosix);
};
-class RendererCrashHandlerHostLinux : public CrashHandlerHostLinux {
+class RendererCrashHandlerHostPosix : public CrashHandlerHostPosix {
public:
// Returns the singleton instance.
- static RendererCrashHandlerHostLinux* GetInstance();
+ static RendererCrashHandlerHostPosix* GetInstance();
private:
- friend struct DefaultSingletonTraits<RendererCrashHandlerHostLinux>;
- RendererCrashHandlerHostLinux();
- virtual ~RendererCrashHandlerHostLinux();
+ friend struct DefaultSingletonTraits<RendererCrashHandlerHostPosix>;
+ RendererCrashHandlerHostPosix();
+ virtual ~RendererCrashHandlerHostPosix();
-#if defined(USE_LINUX_BREAKPAD)
+#if defined(USE_POSIX_BREAKPAD)
virtual void SetProcessType() OVERRIDE;
#endif
- DISALLOW_COPY_AND_ASSIGN(RendererCrashHandlerHostLinux);
+ DISALLOW_COPY_AND_ASSIGN(RendererCrashHandlerHostPosix);
};
-#endif // CHROME_BROWSER_CRASH_HANDLER_HOST_LINUX_H_
+#endif // CHROME_BROWSER_CRASH_HANDLER_HOST_POSIX_H_

Powered by Google App Engine
This is Rietveld 408576698