diff options
Diffstat (limited to 'chrome/browser/crash_handler_host_linux.cc')
-rw-r--r-- | chrome/browser/crash_handler_host_linux.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/chrome/browser/crash_handler_host_linux.cc b/chrome/browser/crash_handler_host_linux.cc index a941cdd..196352a 100644 --- a/chrome/browser/crash_handler_host_linux.cc +++ b/chrome/browser/crash_handler_host_linux.cc @@ -19,6 +19,7 @@ #include "base/message_loop.h" #include "base/path_service.h" #include "base/rand_util.h" +#include "base/singleton.h" #include "base/string_util.h" #include "base/task.h" #include "base/thread.h" @@ -118,20 +119,23 @@ void CrashHandlerHostLinux::OnFileCanReadWithoutBlocking(int fd) { static const unsigned kCrashContextSize = sizeof(ExceptionHandler::CrashContext); + const size_t kIovSize = 7; struct msghdr msg = {0}; - struct iovec iov[6]; + struct iovec iov[kIovSize]; char crash_context[kCrashContextSize]; char* guid = new char[kGuidSize + 1]; char* crash_url = new char[kMaxActiveURLSize + 1]; char* distro = new char[kDistroSize + 1]; char* tid_buf_addr = NULL; int tid_fd = -1; + uint64_t uptime; char control[kControlMsgSize]; const ssize_t expected_msg_size = sizeof(crash_context) + kGuidSize + 1 + kMaxActiveURLSize + 1 + kDistroSize + 1 + - sizeof(tid_buf_addr) + sizeof(tid_fd); + sizeof(tid_buf_addr) + sizeof(tid_fd) + + sizeof(uptime); iov[0].iov_base = crash_context; iov[0].iov_len = sizeof(crash_context); @@ -145,8 +149,10 @@ void CrashHandlerHostLinux::OnFileCanReadWithoutBlocking(int fd) { iov[4].iov_len = sizeof(tid_buf_addr); iov[5].iov_base = &tid_fd; iov[5].iov_len = sizeof(tid_fd); + iov[6].iov_base = &uptime; + iov[6].iov_len = sizeof(uptime); msg.msg_iov = iov; - msg.msg_iovlen = 6; + msg.msg_iovlen = kIovSize; msg.msg_control = control; msg.msg_controllen = kControlMsgSize; @@ -328,6 +334,7 @@ void CrashHandlerHostLinux::OnFileCanReadWithoutBlocking(int fd) { info->distro = distro; info->upload = upload; + info->process_start_time = uptime; uploader_thread_->message_loop()->PostTask( FROM_HERE, @@ -358,6 +365,11 @@ void PluginCrashHandlerHostLinux::SetProcessType() { process_type_ = "plugin"; } +// static +PluginCrashHandlerHostLinux* PluginCrashHandlerHostLinux::GetInstance() { + return Singleton<PluginCrashHandlerHostLinux>::get(); +} + RendererCrashHandlerHostLinux::RendererCrashHandlerHostLinux() { InitCrashUploaderThread(); } @@ -368,3 +380,8 @@ RendererCrashHandlerHostLinux::~RendererCrashHandlerHostLinux() { void RendererCrashHandlerHostLinux::SetProcessType() { process_type_ = "renderer"; } + +// static +RendererCrashHandlerHostLinux* RendererCrashHandlerHostLinux::GetInstance() { + return Singleton<RendererCrashHandlerHostLinux>::get(); +} |