OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_LINUX_H_ |
6 #define CHROME_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ | 6 #define CHROME_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 // This is the base class for singleton objects which crash dump renderers and | 27 // This is the base class for singleton objects which crash dump renderers and |
28 // plugins on Linux or Android. We perform the crash dump from the browser | 28 // plugins on Linux or Android. We perform the crash dump from the browser |
29 // because it allows us to be outside the sandbox. | 29 // because it allows us to be outside the sandbox. |
30 // | 30 // |
31 // PluginCrashHandlerHostLinux and RendererCrashHandlerHostLinux are | 31 // PluginCrashHandlerHostLinux and RendererCrashHandlerHostLinux are |
32 // singletons that handle plugin and renderer crashes, respectively. | 32 // singletons that handle plugin and renderer crashes, respectively. |
33 // | 33 // |
34 // Processes signal that they need to be dumped by sending a datagram over a | 34 // Processes signal that they need to be dumped by sending a datagram over a |
35 // UNIX domain socket. All processes of the same type share the client end of | 35 // UNIX domain socket. All processes of the same type share the client end of |
36 // this socket which is installed in their descriptor table before exec. | 36 // this socket which is installed in their descriptor table before exec. |
37 class CrashHandlerHostLinux : public MessageLoopForIO::Watcher, | 37 class CrashHandlerHostLinux : public base::MessageLoopForIO::Watcher, |
38 public MessageLoop::DestructionObserver { | 38 public base::MessageLoop::DestructionObserver { |
39 public: | 39 public: |
40 // Get the file descriptor which processes should be given in order to signal | 40 // Get the file descriptor which processes should be given in order to signal |
41 // crashes to the browser. | 41 // crashes to the browser. |
42 int GetDeathSignalSocket() const { | 42 int GetDeathSignalSocket() const { |
43 return process_socket_; | 43 return process_socket_; |
44 } | 44 } |
45 | 45 |
46 // MessagePumbLibevent::Watcher impl: | 46 // MessagePumbLibevent::Watcher impl: |
47 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; | 47 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; |
48 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; | 48 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 int signal_fd); | 80 int signal_fd); |
81 | 81 |
82 // Continue OnFileCanReadWithoutBlocking()'s work on the IO thread. | 82 // Continue OnFileCanReadWithoutBlocking()'s work on the IO thread. |
83 void QueueCrashDumpTask(BreakpadInfo* info, int signal_fd); | 83 void QueueCrashDumpTask(BreakpadInfo* info, int signal_fd); |
84 #endif | 84 #endif |
85 | 85 |
86 int process_socket_; | 86 int process_socket_; |
87 int browser_socket_; | 87 int browser_socket_; |
88 | 88 |
89 #if defined(USE_LINUX_BREAKPAD) | 89 #if defined(USE_LINUX_BREAKPAD) |
90 MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_; | 90 base::MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_; |
91 scoped_ptr<base::Thread> uploader_thread_; | 91 scoped_ptr<base::Thread> uploader_thread_; |
92 bool shutting_down_; | 92 bool shutting_down_; |
93 #endif | 93 #endif |
94 | 94 |
95 #if defined(ADDRESS_SANITIZER) | 95 #if defined(ADDRESS_SANITIZER) |
96 char* asan_report_str_; | 96 char* asan_report_str_; |
97 #endif | 97 #endif |
98 | 98 |
99 DISALLOW_COPY_AND_ASSIGN(CrashHandlerHostLinux); | 99 DISALLOW_COPY_AND_ASSIGN(CrashHandlerHostLinux); |
100 }; | 100 }; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 virtual ~RendererCrashHandlerHostLinux(); | 178 virtual ~RendererCrashHandlerHostLinux(); |
179 | 179 |
180 #if defined(USE_LINUX_BREAKPAD) | 180 #if defined(USE_LINUX_BREAKPAD) |
181 virtual void SetProcessType() OVERRIDE; | 181 virtual void SetProcessType() OVERRIDE; |
182 #endif | 182 #endif |
183 | 183 |
184 DISALLOW_COPY_AND_ASSIGN(RendererCrashHandlerHostLinux); | 184 DISALLOW_COPY_AND_ASSIGN(RendererCrashHandlerHostLinux); |
185 }; | 185 }; |
186 | 186 |
187 #endif // CHROME_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ | 187 #endif // CHROME_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ |
OLD | NEW |