OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
13 #include "base/singleton.h" | 13 |
| 14 template <typename T> struct DefaultSingletonTraits; |
14 | 15 |
15 namespace base { | 16 namespace base { |
16 class Thread; | 17 class Thread; |
17 } | 18 } |
18 | 19 |
19 // This is the base class for singleton objects which crash dump renderers and | 20 // This is the base class for singleton objects which crash dump renderers and |
20 // plugins on Linux. We perform the crash dump from the browser because it | 21 // plugins on Linux. We perform the crash dump from the browser because it |
21 // allows us to be outside the sandbox. | 22 // allows us to be outside the sandbox. |
22 // | 23 // |
23 // PluginCrashHandlerHostLinux and RendererCrashHandlerHostLinux are singletons | 24 // PluginCrashHandlerHostLinux and RendererCrashHandlerHostLinux are singletons |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 #if defined(USE_LINUX_BREAKPAD) | 73 #if defined(USE_LINUX_BREAKPAD) |
73 MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_; | 74 MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_; |
74 scoped_ptr<base::Thread> uploader_thread_; | 75 scoped_ptr<base::Thread> uploader_thread_; |
75 bool shutting_down_; | 76 bool shutting_down_; |
76 #endif | 77 #endif |
77 | 78 |
78 DISALLOW_COPY_AND_ASSIGN(CrashHandlerHostLinux); | 79 DISALLOW_COPY_AND_ASSIGN(CrashHandlerHostLinux); |
79 }; | 80 }; |
80 | 81 |
81 class PluginCrashHandlerHostLinux : public CrashHandlerHostLinux { | 82 class PluginCrashHandlerHostLinux : public CrashHandlerHostLinux { |
| 83 public: |
| 84 // Returns the singleton instance. |
| 85 static PluginCrashHandlerHostLinux* GetInstance(); |
| 86 |
82 private: | 87 private: |
83 friend struct DefaultSingletonTraits<PluginCrashHandlerHostLinux>; | 88 friend struct DefaultSingletonTraits<PluginCrashHandlerHostLinux>; |
84 PluginCrashHandlerHostLinux(); | 89 PluginCrashHandlerHostLinux(); |
85 virtual ~PluginCrashHandlerHostLinux(); | 90 virtual ~PluginCrashHandlerHostLinux(); |
86 | 91 |
87 #if defined(USE_LINUX_BREAKPAD) | 92 #if defined(USE_LINUX_BREAKPAD) |
88 virtual void SetProcessType(); | 93 virtual void SetProcessType(); |
89 #endif | 94 #endif |
90 | 95 |
91 DISALLOW_COPY_AND_ASSIGN(PluginCrashHandlerHostLinux); | 96 DISALLOW_COPY_AND_ASSIGN(PluginCrashHandlerHostLinux); |
92 }; | 97 }; |
93 | 98 |
94 class RendererCrashHandlerHostLinux : public CrashHandlerHostLinux { | 99 class RendererCrashHandlerHostLinux : public CrashHandlerHostLinux { |
| 100 public: |
| 101 // Returns the singleton instance. |
| 102 static RendererCrashHandlerHostLinux* GetInstance(); |
| 103 |
95 private: | 104 private: |
96 friend struct DefaultSingletonTraits<RendererCrashHandlerHostLinux>; | 105 friend struct DefaultSingletonTraits<RendererCrashHandlerHostLinux>; |
97 RendererCrashHandlerHostLinux(); | 106 RendererCrashHandlerHostLinux(); |
98 virtual ~RendererCrashHandlerHostLinux(); | 107 virtual ~RendererCrashHandlerHostLinux(); |
99 | 108 |
100 #if defined(USE_LINUX_BREAKPAD) | 109 #if defined(USE_LINUX_BREAKPAD) |
101 virtual void SetProcessType(); | 110 virtual void SetProcessType(); |
102 #endif | 111 #endif |
103 | 112 |
104 DISALLOW_COPY_AND_ASSIGN(RendererCrashHandlerHostLinux); | 113 DISALLOW_COPY_AND_ASSIGN(RendererCrashHandlerHostLinux); |
105 }; | 114 }; |
106 | 115 |
107 #endif // CHROME_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ | 116 #endif // CHROME_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ |
OLD | NEW |