diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-16 19:44:09 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-16 19:44:09 +0000 |
commit | 19eef069c3a53544627254e54f88ae8bbc8c40a7 (patch) | |
tree | 159ae40d233afad309702dfb7e0f1272617bf5d4 /chrome | |
parent | 90db7d15b2e3b9be1e9d4131b32bf5616cf11d0f (diff) | |
download | chromium_src-19eef069c3a53544627254e54f88ae8bbc8c40a7.zip chromium_src-19eef069c3a53544627254e54f88ae8bbc8c40a7.tar.gz chromium_src-19eef069c3a53544627254e54f88ae8bbc8c40a7.tar.bz2 |
Linux: Fix pure call in CrashHandlerHostLinux::Init().
BUG=55780
TEST=no more random crashes on startup.
Review URL: http://codereview.chromium.org/3417005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59696 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/crash_handler_host_linux.cc | 14 | ||||
-rw-r--r-- | chrome/browser/crash_handler_host_linux.h | 11 |
2 files changed, 18 insertions, 7 deletions
diff --git a/chrome/browser/crash_handler_host_linux.cc b/chrome/browser/crash_handler_host_linux.cc index 06ceb96..6f3d183 100644 --- a/chrome/browser/crash_handler_host_linux.cc +++ b/chrome/browser/crash_handler_host_linux.cc @@ -83,11 +83,6 @@ CrashHandlerHostLinux::~CrashHandlerHostLinux() { } void CrashHandlerHostLinux::Init() { - SetProcessType(); - uploader_thread_.reset( - new base::Thread(std::string(process_type_ + "_crash_uploader").c_str())); - uploader_thread_->Start(); - MessageLoopForIO* ml = MessageLoopForIO::current(); CHECK(ml->WatchFileDescriptor( browser_socket_, true /* persistent */, @@ -96,6 +91,13 @@ void CrashHandlerHostLinux::Init() { ml->AddDestructionObserver(this); } +void CrashHandlerHostLinux::InitCrashUploaderThread() { + SetProcessType(); + uploader_thread_.reset( + new base::Thread(std::string(process_type_ + "_crash_uploader").c_str())); + uploader_thread_->Start(); +} + void CrashHandlerHostLinux::OnFileCanWriteWithoutBlocking(int fd) { DCHECK(false); } @@ -336,6 +338,7 @@ void CrashHandlerHostLinux::WillDestroyCurrentMessageLoop() { } PluginCrashHandlerHostLinux::PluginCrashHandlerHostLinux() { + InitCrashUploaderThread(); } PluginCrashHandlerHostLinux::~PluginCrashHandlerHostLinux() { @@ -346,6 +349,7 @@ void PluginCrashHandlerHostLinux::SetProcessType() { } RendererCrashHandlerHostLinux::RendererCrashHandlerHostLinux() { + InitCrashUploaderThread(); } RendererCrashHandlerHostLinux::~RendererCrashHandlerHostLinux() { diff --git a/chrome/browser/crash_handler_host_linux.h b/chrome/browser/crash_handler_host_linux.h index a31300c..0e7bf6e 100644 --- a/chrome/browser/crash_handler_host_linux.h +++ b/chrome/browser/crash_handler_host_linux.h @@ -45,9 +45,10 @@ class CrashHandlerHostLinux : public MessageLoopForIO::Watcher, protected: CrashHandlerHostLinux(); virtual ~CrashHandlerHostLinux(); + #if defined(USE_LINUX_BREAKPAD) - // This is here on purpose to make CrashHandlerHostLinux abstract. - virtual void SetProcessType() = 0; + // Only called in concrete subclasses. + void InitCrashUploaderThread(); std::string process_type_; #endif @@ -55,8 +56,14 @@ class CrashHandlerHostLinux : public MessageLoopForIO::Watcher, private: void Init(); +#if defined(USE_LINUX_BREAKPAD) + // This is here on purpose to make CrashHandlerHostLinux abstract. + virtual void SetProcessType() = 0; +#endif + int process_socket_; int browser_socket_; + #if defined(USE_LINUX_BREAKPAD) MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_; scoped_ptr<base::Thread> uploader_thread_; |