OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ | 5 #ifndef CHROME_BROWSER_CRASH_HANDLER_HOST_LINUXISH_H_ |
6 #define CHROME_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ | 6 #define CHROME_BROWSER_CRASH_HANDLER_HOST_LINUXISH_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 | 11 |
12 #if defined(USE_LINUX_BREAKPAD) | 12 #if defined(USE_LINUX_BREAKPAD) |
13 #include <sys/types.h> | 13 #include <sys/types.h> |
14 | 14 |
15 #include <string> | 15 #include <string> |
16 | 16 |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 | 18 |
19 class BreakpadInfo; | 19 class BreakpadInfo; |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class Thread; | 22 class Thread; |
23 } | 23 } |
24 #endif // defined(USE_LINUX_BREAKPAD) | 24 #endif // defined(USE_LINUX_BREAKPAD) |
25 | 25 |
26 template <typename T> struct DefaultSingletonTraits; | 26 template <typename T> struct DefaultSingletonTraits; |
27 | 27 |
28 // This is the base class for singleton objects which crash dump renderers and | 28 // This is the base class for singleton objects which crash dump renderers and |
29 // plugins on Linux. We perform the crash dump from the browser because it | 29 // plugins on Linux or Android. We perform the crash dump from the browser |
30 // allows us to be outside the sandbox. | 30 // because it allows us to be outside the sandbox. |
31 // | 31 // |
32 // PluginCrashHandlerHostLinux and RendererCrashHandlerHostLinux are singletons | 32 // PluginCrashHandlerHostLinux and RendererCrashHandlerHostLinux are |
33 // that handle plugin and renderer crashes, respectively. | 33 // singletons that handle plugin and renderer crashes, respectively. |
34 // | 34 // |
35 // Processes signal that they need to be dumped by sending a datagram over a | 35 // Processes signal that they need to be dumped by sending a datagram over a |
36 // UNIX domain socket. All processes of the same type share the client end of | 36 // UNIX domain socket. All processes of the same type share the client end of |
37 // this socket which is installed in their descriptor table before exec. | 37 // this socket which is installed in their descriptor table before exec. |
38 class CrashHandlerHostLinux : public MessageLoopForIO::Watcher, | 38 class CrashHandlerHostLinux : public MessageLoopForIO::Watcher, |
39 public MessageLoop::DestructionObserver { | 39 public MessageLoop::DestructionObserver { |
40 public: | 40 public: |
41 // Get the file descriptor which processes should be given in order to signal | 41 // Get the file descriptor which processes should be given in order to signal |
42 // crashes to the browser. | 42 // crashes to the browser. |
43 int GetDeathSignalSocket() const { | 43 int GetDeathSignalSocket() const { |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 RendererCrashHandlerHostLinux(); | 174 RendererCrashHandlerHostLinux(); |
175 virtual ~RendererCrashHandlerHostLinux(); | 175 virtual ~RendererCrashHandlerHostLinux(); |
176 | 176 |
177 #if defined(USE_LINUX_BREAKPAD) | 177 #if defined(USE_LINUX_BREAKPAD) |
178 virtual void SetProcessType() OVERRIDE; | 178 virtual void SetProcessType() OVERRIDE; |
179 #endif | 179 #endif |
180 | 180 |
181 DISALLOW_COPY_AND_ASSIGN(RendererCrashHandlerHostLinux); | 181 DISALLOW_COPY_AND_ASSIGN(RendererCrashHandlerHostLinux); |
182 }; | 182 }; |
183 | 183 |
184 #endif // CHROME_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ | 184 #endif // CHROME_BROWSER_CRASH_HANDLER_HOST_LINUXISH_H_ |
OLD | NEW |