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

Side by Side Diff: chrome/browser/crash_handler_host_linux.h

Issue 5519016: Add a new GetInstance() method for singleton classes used in chrome/browser files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "base/singleton.h"
joth 2010/12/08 17:15:07 remove
14 14
15 namespace base { 15 namespace base {
16 class Thread; 16 class Thread;
17 } 17 }
18 18
19 // This is the base class for singleton objects which crash dump renderers and 19 // 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 20 // plugins on Linux. We perform the crash dump from the browser because it
21 // allows us to be outside the sandbox. 21 // allows us to be outside the sandbox.
22 // 22 //
23 // PluginCrashHandlerHostLinux and RendererCrashHandlerHostLinux are singletons 23 // PluginCrashHandlerHostLinux and RendererCrashHandlerHostLinux are singletons
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 #if defined(USE_LINUX_BREAKPAD) 72 #if defined(USE_LINUX_BREAKPAD)
73 MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_; 73 MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_;
74 scoped_ptr<base::Thread> uploader_thread_; 74 scoped_ptr<base::Thread> uploader_thread_;
75 bool shutting_down_; 75 bool shutting_down_;
76 #endif 76 #endif
77 77
78 DISALLOW_COPY_AND_ASSIGN(CrashHandlerHostLinux); 78 DISALLOW_COPY_AND_ASSIGN(CrashHandlerHostLinux);
79 }; 79 };
80 80
81 class PluginCrashHandlerHostLinux : public CrashHandlerHostLinux { 81 class PluginCrashHandlerHostLinux : public CrashHandlerHostLinux {
82 public:
83 // Returns the singleton instance.
84 static PluginCrashHandlerHostLinux* GetInstance();
85
82 private: 86 private:
83 friend struct DefaultSingletonTraits<PluginCrashHandlerHostLinux>; 87 friend struct DefaultSingletonTraits<PluginCrashHandlerHostLinux>;
84 PluginCrashHandlerHostLinux(); 88 PluginCrashHandlerHostLinux();
85 virtual ~PluginCrashHandlerHostLinux(); 89 virtual ~PluginCrashHandlerHostLinux();
86 90
87 #if defined(USE_LINUX_BREAKPAD) 91 #if defined(USE_LINUX_BREAKPAD)
88 virtual void SetProcessType(); 92 virtual void SetProcessType();
89 #endif 93 #endif
90 94
91 DISALLOW_COPY_AND_ASSIGN(PluginCrashHandlerHostLinux); 95 DISALLOW_COPY_AND_ASSIGN(PluginCrashHandlerHostLinux);
92 }; 96 };
93 97
94 class RendererCrashHandlerHostLinux : public CrashHandlerHostLinux { 98 class RendererCrashHandlerHostLinux : public CrashHandlerHostLinux {
99 public:
100 // Returns the singleton instance.
101 static RendererCrashHandlerHostLinux* GetInstance();
102
95 private: 103 private:
96 friend struct DefaultSingletonTraits<RendererCrashHandlerHostLinux>; 104 friend struct DefaultSingletonTraits<RendererCrashHandlerHostLinux>;
97 RendererCrashHandlerHostLinux(); 105 RendererCrashHandlerHostLinux();
98 virtual ~RendererCrashHandlerHostLinux(); 106 virtual ~RendererCrashHandlerHostLinux();
99 107
100 #if defined(USE_LINUX_BREAKPAD) 108 #if defined(USE_LINUX_BREAKPAD)
101 virtual void SetProcessType(); 109 virtual void SetProcessType();
102 #endif 110 #endif
103 111
104 DISALLOW_COPY_AND_ASSIGN(RendererCrashHandlerHostLinux); 112 DISALLOW_COPY_AND_ASSIGN(RendererCrashHandlerHostLinux);
105 }; 113 };
106 114
107 #endif // CHROME_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ 115 #endif // CHROME_BROWSER_CRASH_HANDLER_HOST_LINUX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698