blob: a013f1d0603585c72a962344ce86a2a90874d2ea [file] [log] [blame]
[email protected]154cbabd2011-02-17 23:01:571// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]9a5d2a52009-05-22 03:37:452// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]2456c572009-11-09 04:21:515#include "chrome/browser/crash_handler_host_linux.h"
[email protected]9a5d2a52009-05-22 03:37:456
[email protected]9a5d2a52009-05-22 03:37:457#include <stdint.h>
[email protected]85ebe8f2009-10-29 04:02:558#include <stdlib.h>
[email protected]9a5d2a52009-05-22 03:37:459#include <sys/socket.h>
[email protected]662183142010-07-16 19:28:1710#include <sys/syscall.h>
[email protected]4378a822009-07-08 01:15:1411#include <unistd.h>
12
[email protected]9a5d2a52009-05-22 03:37:4513#include "base/eintr_wrapper.h"
[email protected]cbd5fd52009-08-26 00:14:2714#include "base/file_path.h"
[email protected]c725d7922009-06-30 00:05:0815#include "base/format_macros.h"
[email protected]85ebe8f2009-10-29 04:02:5516#include "base/linux_util.h"
[email protected]9a5d2a52009-05-22 03:37:4517#include "base/logging.h"
[email protected]3b63f8f42011-03-28 01:54:1518#include "base/memory/singleton.h"
[email protected]9a5d2a52009-05-22 03:37:4519#include "base/message_loop.h"
[email protected]cbd5fd52009-08-26 00:14:2720#include "base/path_service.h"
[email protected]9a5d2a52009-05-22 03:37:4521#include "base/rand_util.h"
22#include "base/string_util.h"
[email protected]b064f0eb2010-09-02 23:53:2623#include "base/task.h"
[email protected]34b99632011-01-01 01:01:0624#include "base/threading/thread.h"
[email protected]b07fc5112009-12-02 01:55:0625#include "breakpad/src/client/linux/handler/exception_handler.h"
26#include "breakpad/src/client/linux/minidump_writer/linux_dumper.h"
27#include "breakpad/src/client/linux/minidump_writer/minidump_writer.h"
[email protected]9a5d2a52009-05-22 03:37:4528#include "chrome/app/breakpad_linux.h"
[email protected]cbd5fd52009-08-26 00:14:2729#include "chrome/common/chrome_paths.h"
[email protected]99ca9a12010-03-12 18:32:1030#include "chrome/common/env_vars.h"
[email protected]3781908b2011-03-01 22:49:1531#include "content/browser/browser_thread.h"
[email protected]9a5d2a52009-05-22 03:37:4532
[email protected]662183142010-07-16 19:28:1733using google_breakpad::ExceptionHandler;
34
[email protected]b064f0eb2010-09-02 23:53:2635namespace {
36
[email protected]154cbabd2011-02-17 23:01:5737// The length of the control message:
38const unsigned kControlMsgSize =
39 CMSG_SPACE(2*sizeof(int)) + CMSG_SPACE(sizeof(struct ucred));
40// The length of the regular payload:
41const unsigned kCrashContextSize = sizeof(ExceptionHandler::CrashContext);
42
[email protected]b064f0eb2010-09-02 23:53:2643// Handles the crash dump and frees the allocated BreakpadInfo struct.
[email protected]ca779662010-11-11 23:28:4344void CrashDumpTask(CrashHandlerHostLinux* handler, BreakpadInfo* info) {
45 if (handler->IsShuttingDown())
46 return;
47
[email protected]b064f0eb2010-09-02 23:53:2648 HandleCrashDump(*info);
49 delete[] info->filename;
50 delete[] info->process_type;
51 delete[] info->crash_url;
52 delete[] info->guid;
53 delete[] info->distro;
54 delete info;
55}
56
57} // namespace
58
[email protected]2456c572009-11-09 04:21:5159// Since classes derived from CrashHandlerHostLinux are singletons, it's only
60// destroyed at the end of the processes lifetime, which is greater in span than
61// the lifetime of the IO message loop.
[email protected]c56428f22010-06-16 02:17:2362DISABLE_RUNNABLE_METHOD_REFCOUNT(CrashHandlerHostLinux);
[email protected]9a5d2a52009-05-22 03:37:4563
[email protected]ca779662010-11-11 23:28:4364CrashHandlerHostLinux::CrashHandlerHostLinux()
65 : shutting_down_(false) {
[email protected]9a5d2a52009-05-22 03:37:4566 int fds[2];
[email protected]2456c572009-11-09 04:21:5167 // We use SOCK_SEQPACKET rather than SOCK_DGRAM to prevent the process from
[email protected]54730a12009-10-07 22:55:4868 // sending datagrams to other sockets on the system. The sandbox may prevent
[email protected]2456c572009-11-09 04:21:5169 // the process from calling socket() to create new sockets, but it'll still
[email protected]54730a12009-10-07 22:55:4870 // inherit some sockets. With PF_UNIX+SOCK_DGRAM, it can call sendmsg to send
71 // a datagram to any (abstract) socket on the same system. With
72 // SOCK_SEQPACKET, this is prevented.
[email protected]c83dd912010-04-06 18:50:5173 CHECK_EQ(socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds), 0);
[email protected]9a5d2a52009-05-22 03:37:4574 static const int on = 1;
75
76 // Enable passcred on the server end of the socket
[email protected]c83dd912010-04-06 18:50:5177 CHECK_EQ(setsockopt(fds[1], SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)), 0);
[email protected]9a5d2a52009-05-22 03:37:4578
[email protected]2456c572009-11-09 04:21:5179 process_socket_ = fds[0];
[email protected]9a5d2a52009-05-22 03:37:4580 browser_socket_ = fds[1];
81
[email protected]d04e7662010-10-10 22:24:4882 BrowserThread::PostTask(
83 BrowserThread::IO, FROM_HERE,
[email protected]2456c572009-11-09 04:21:5184 NewRunnableMethod(this, &CrashHandlerHostLinux::Init));
[email protected]9a5d2a52009-05-22 03:37:4585}
86
[email protected]2456c572009-11-09 04:21:5187CrashHandlerHostLinux::~CrashHandlerHostLinux() {
88 HANDLE_EINTR(close(process_socket_));
[email protected]9a5d2a52009-05-22 03:37:4589 HANDLE_EINTR(close(browser_socket_));
90}
91
[email protected]2456c572009-11-09 04:21:5192void CrashHandlerHostLinux::Init() {
[email protected]9a5d2a52009-05-22 03:37:4593 MessageLoopForIO* ml = MessageLoopForIO::current();
94 CHECK(ml->WatchFileDescriptor(
95 browser_socket_, true /* persistent */,
96 MessageLoopForIO::WATCH_READ,
97 &file_descriptor_watcher_, this));
98 ml->AddDestructionObserver(this);
99}
100
[email protected]19eef062010-09-16 19:44:09101void CrashHandlerHostLinux::InitCrashUploaderThread() {
102 SetProcessType();
103 uploader_thread_.reset(
104 new base::Thread(std::string(process_type_ + "_crash_uploader").c_str()));
105 uploader_thread_->Start();
106}
107
[email protected]2456c572009-11-09 04:21:51108void CrashHandlerHostLinux::OnFileCanWriteWithoutBlocking(int fd) {
[email protected]9a5d2a52009-05-22 03:37:45109 DCHECK(false);
110}
111
[email protected]2456c572009-11-09 04:21:51112void CrashHandlerHostLinux::OnFileCanReadWithoutBlocking(int fd) {
[email protected]9a5d2a52009-05-22 03:37:45113 DCHECK_EQ(fd, browser_socket_);
114
[email protected]2456c572009-11-09 04:21:51115 // A process has crashed and has signaled us by writing a datagram
[email protected]9a5d2a52009-05-22 03:37:45116 // to the death signal socket. The datagram contains the crash context needed
117 // for writing the minidump as well as a file descriptor and a credentials
118 // block so that they can't lie about their pid.
119
[email protected]c7b1d2f2010-12-03 03:33:13120 const size_t kIovSize = 7;
[email protected]9a5d2a52009-05-22 03:37:45121 struct msghdr msg = {0};
[email protected]c7b1d2f2010-12-03 03:33:13122 struct iovec iov[kIovSize];
[email protected]c468f9492011-04-15 20:56:37123
124 // Freed in WriteDumpFile();
125 char* crash_context = new char[kCrashContextSize];
126 // Freed in CrashDumpTask();
[email protected]b064f0eb2010-09-02 23:53:26127 char* guid = new char[kGuidSize + 1];
128 char* crash_url = new char[kMaxActiveURLSize + 1];
129 char* distro = new char[kDistroSize + 1];
[email protected]c468f9492011-04-15 20:56:37130
[email protected]662183142010-07-16 19:28:17131 char* tid_buf_addr = NULL;
132 int tid_fd = -1;
[email protected]c7b1d2f2010-12-03 03:33:13133 uint64_t uptime;
[email protected]9a5d2a52009-05-22 03:37:45134 char control[kControlMsgSize];
[email protected]c468f9492011-04-15 20:56:37135 const ssize_t expected_msg_size =
136 kCrashContextSize +
[email protected]b064f0eb2010-09-02 23:53:26137 kGuidSize + 1 +
138 kMaxActiveURLSize + 1 +
139 kDistroSize + 1 +
[email protected]c7b1d2f2010-12-03 03:33:13140 sizeof(tid_buf_addr) + sizeof(tid_fd) +
141 sizeof(uptime);
[email protected]2eb41e72009-07-15 23:07:34142
143 iov[0].iov_base = crash_context;
[email protected]c468f9492011-04-15 20:56:37144 iov[0].iov_len = kCrashContextSize;
[email protected]2eb41e72009-07-15 23:07:34145 iov[1].iov_base = guid;
[email protected]b064f0eb2010-09-02 23:53:26146 iov[1].iov_len = kGuidSize + 1;
[email protected]2eb41e72009-07-15 23:07:34147 iov[2].iov_base = crash_url;
[email protected]b064f0eb2010-09-02 23:53:26148 iov[2].iov_len = kMaxActiveURLSize + 1;
[email protected]912c6452009-07-17 05:55:51149 iov[3].iov_base = distro;
[email protected]b064f0eb2010-09-02 23:53:26150 iov[3].iov_len = kDistroSize + 1;
[email protected]662183142010-07-16 19:28:17151 iov[4].iov_base = &tid_buf_addr;
152 iov[4].iov_len = sizeof(tid_buf_addr);
153 iov[5].iov_base = &tid_fd;
154 iov[5].iov_len = sizeof(tid_fd);
[email protected]c7b1d2f2010-12-03 03:33:13155 iov[6].iov_base = &uptime;
156 iov[6].iov_len = sizeof(uptime);
[email protected]2eb41e72009-07-15 23:07:34157 msg.msg_iov = iov;
[email protected]c7b1d2f2010-12-03 03:33:13158 msg.msg_iovlen = kIovSize;
[email protected]9a5d2a52009-05-22 03:37:45159 msg.msg_control = control;
160 msg.msg_controllen = kControlMsgSize;
161
[email protected]2eb41e72009-07-15 23:07:34162 const ssize_t msg_size = HANDLE_EINTR(recvmsg(browser_socket_, &msg, 0));
163 if (msg_size != expected_msg_size) {
[email protected]9a5d2a52009-05-22 03:37:45164 LOG(ERROR) << "Error reading from death signal socket. Crash dumping"
165 << " is disabled."
[email protected]2eb41e72009-07-15 23:07:34166 << " msg_size:" << msg_size
[email protected]9a5d2a52009-05-22 03:37:45167 << " errno:" << errno;
168 file_descriptor_watcher_.StopWatchingFileDescriptor();
169 return;
170 }
171
[email protected]2eb41e72009-07-15 23:07:34172 if (msg.msg_controllen != kControlMsgSize ||
[email protected]9a5d2a52009-05-22 03:37:45173 msg.msg_flags & ~MSG_TRUNC) {
174 LOG(ERROR) << "Received death signal message with the wrong size;"
[email protected]9a5d2a52009-05-22 03:37:45175 << " msg.msg_controllen:" << msg.msg_controllen
176 << " msg.msg_flags:" << msg.msg_flags
177 << " kCrashContextSize:" << kCrashContextSize
178 << " kControlMsgSize:" << kControlMsgSize;
179 return;
180 }
181
[email protected]9a5d2a52009-05-22 03:37:45182 // Walk the control payload an extract the file descriptor and validated pid.
183 pid_t crashing_pid = -1;
[email protected]15e85772010-08-09 20:44:03184 int partner_fd = -1;
[email protected]9a5d2a52009-05-22 03:37:45185 int signal_fd = -1;
186 for (struct cmsghdr *hdr = CMSG_FIRSTHDR(&msg); hdr;
187 hdr = CMSG_NXTHDR(&msg, hdr)) {
188 if (hdr->cmsg_level != SOL_SOCKET)
189 continue;
190 if (hdr->cmsg_type == SCM_RIGHTS) {
191 const unsigned len = hdr->cmsg_len -
192 (((uint8_t*)CMSG_DATA(hdr)) - (uint8_t*)hdr);
[email protected]912c6452009-07-17 05:55:51193 DCHECK_EQ(len % sizeof(int), 0u);
[email protected]9a5d2a52009-05-22 03:37:45194 const unsigned num_fds = len / sizeof(int);
[email protected]15e85772010-08-09 20:44:03195 if (num_fds != 2) {
[email protected]2456c572009-11-09 04:21:51196 // A nasty process could try and send us too many descriptors and
[email protected]9a5d2a52009-05-22 03:37:45197 // force a leak.
[email protected]15e85772010-08-09 20:44:03198 LOG(ERROR) << "Death signal contained wrong number of descriptors;"
[email protected]9a5d2a52009-05-22 03:37:45199 << " num_fds:" << num_fds;
200 for (unsigned i = 0; i < num_fds; ++i)
201 HANDLE_EINTR(close(reinterpret_cast<int*>(CMSG_DATA(hdr))[i]));
202 return;
203 } else {
[email protected]15e85772010-08-09 20:44:03204 partner_fd = reinterpret_cast<int*>(CMSG_DATA(hdr))[0];
205 signal_fd = reinterpret_cast<int*>(CMSG_DATA(hdr))[1];
[email protected]9a5d2a52009-05-22 03:37:45206 }
207 } else if (hdr->cmsg_type == SCM_CREDENTIALS) {
208 const struct ucred *cred =
209 reinterpret_cast<struct ucred*>(CMSG_DATA(hdr));
210 crashing_pid = cred->pid;
211 }
212 }
213
[email protected]15e85772010-08-09 20:44:03214 if (crashing_pid == -1 || partner_fd == -1 || signal_fd == -1) {
[email protected]9a5d2a52009-05-22 03:37:45215 LOG(ERROR) << "Death signal message didn't contain all expected control"
216 << " messages";
[email protected]15e85772010-08-09 20:44:03217 if (partner_fd >= 0)
218 HANDLE_EINTR(close(partner_fd));
219 if (signal_fd >= 0)
[email protected]9a5d2a52009-05-22 03:37:45220 HANDLE_EINTR(close(signal_fd));
221 return;
222 }
223
[email protected]cb7d53e2011-06-21 04:21:06224 // Kernel bug workaround (broken in 2.6.30 and 2.6.32, working in 2.6.38).
[email protected]4378a822009-07-08 01:15:14225 // The kernel doesn't translate PIDs in SCM_CREDENTIALS across PID
226 // namespaces. Thus |crashing_pid| might be garbage from our point of view.
227 // In the future we can remove this workaround, but we have to wait a couple
228 // of years to be sure that it's worked its way out into the world.
[email protected]cb7d53e2011-06-21 04:21:06229 // TODO(thestig) Remove the workaround when Ubuntu Lucid is deprecated.
[email protected]4378a822009-07-08 01:15:14230
[email protected]15e85772010-08-09 20:44:03231 // The crashing process closes its copy of the signal_fd immediately after
232 // calling sendmsg(). We can thus not reliably look for with with
233 // FindProcessHoldingSocket(). But by necessity, it has to keep the
234 // partner_fd open until the crashdump is complete.
[email protected]4378a822009-07-08 01:15:14235 uint64_t inode_number;
[email protected]15e85772010-08-09 20:44:03236 if (!base::FileDescriptorGetInode(&inode_number, partner_fd)) {
[email protected]4378a822009-07-08 01:15:14237 LOG(WARNING) << "Failed to get inode number for passed socket";
[email protected]15e85772010-08-09 20:44:03238 HANDLE_EINTR(close(partner_fd));
[email protected]4378a822009-07-08 01:15:14239 HANDLE_EINTR(close(signal_fd));
240 return;
241 }
[email protected]15e85772010-08-09 20:44:03242 HANDLE_EINTR(close(partner_fd));
[email protected]4378a822009-07-08 01:15:14243
[email protected]662183142010-07-16 19:28:17244 pid_t actual_crashing_pid = -1;
[email protected]15e85772010-08-09 20:44:03245 if (!base::FindProcessHoldingSocket(&actual_crashing_pid, inode_number)) {
[email protected]4378a822009-07-08 01:15:14246 LOG(WARNING) << "Failed to find process holding other end of crash reply "
247 "socket";
248 HANDLE_EINTR(close(signal_fd));
249 return;
250 }
[email protected]15e85772010-08-09 20:44:03251
[email protected]cb7d53e2011-06-21 04:21:06252 crashing_pid = actual_crashing_pid;
[email protected]662183142010-07-16 19:28:17253
[email protected]cb7d53e2011-06-21 04:21:06254 // The crashing TID set inside the compromised context via
255 // sys_gettid() in ExceptionHandler::HandleSignal might be wrong (if
256 // the kernel supports PID namespacing) and may need to be
257 // translated.
258 //
259 // We expect the crashing thread to be in sys_read(), waiting for us to
260 // write to |signal_fd|. Most newer kernels where we have the different pid
261 // namespaces also have /proc/[pid]/syscall, so we can look through
262 // |actual_crashing_pid|'s thread group and find the thread that's in the
263 // read syscall with the right arguments.
[email protected]662183142010-07-16 19:28:17264
[email protected]cb7d53e2011-06-21 04:21:06265 std::string expected_syscall_data;
266 // /proc/[pid]/syscall is formatted as follows:
267 // syscall_number arg1 ... arg6 sp pc
268 // but we just check syscall_number through arg3.
269 base::StringAppendF(&expected_syscall_data, "%d 0x%x %p 0x1 ",
270 SYS_read, tid_fd, tid_buf_addr);
271 bool syscall_supported = false;
272 pid_t crashing_tid =
273 base::FindThreadIDWithSyscall(crashing_pid,
274 expected_syscall_data,
275 &syscall_supported);
276 if (crashing_tid == -1 && syscall_supported) {
277 // We didn't find the thread we want. Maybe it didn't reach
278 // sys_read() yet or the thread went away. We'll just take a
279 // guess here and assume the crashing thread is the thread group
280 // leader. If procfs syscall is not supported by the kernel, then
281 // we assume the kernel also does not support TID namespacing and
282 // trust the TID passed by the crashing process.
283 crashing_tid = crashing_pid;
[email protected]662183142010-07-16 19:28:17284 }
[email protected]4378a822009-07-08 01:15:14285
[email protected]cb7d53e2011-06-21 04:21:06286 ExceptionHandler::CrashContext* bad_context =
287 reinterpret_cast<ExceptionHandler::CrashContext*>(crash_context);
288 bad_context->tid = crashing_tid;
289
[email protected]9ddbcd92009-09-23 21:27:43290 // Sanitize the string data a bit more
291 guid[kGuidSize] = crash_url[kMaxActiveURLSize] = distro[kDistroSize] = 0;
292
[email protected]c468f9492011-04-15 20:56:37293 // Freed in CrashDumpTask();
[email protected]b064f0eb2010-09-02 23:53:26294 BreakpadInfo* info = new BreakpadInfo;
295
[email protected]b064f0eb2010-09-02 23:53:26296 info->process_type_length = process_type_.length();
297 char* process_type_str = new char[info->process_type_length + 1];
298 process_type_.copy(process_type_str, info->process_type_length);
299 process_type_str[info->process_type_length] = '\0';
300 info->process_type = process_type_str;
301
302 info->crash_url_length = strlen(crash_url);
303 info->crash_url = crash_url;
304
305 info->guid_length = strlen(guid);
306 info->guid = guid;
307
308 info->distro_length = strlen(distro);
309 info->distro = distro;
310
[email protected]154cbabd2011-02-17 23:01:57311 info->upload = (getenv(env_vars::kHeadless) == NULL);
[email protected]c7b1d2f2010-12-03 03:33:13312 info->process_start_time = uptime;
[email protected]b064f0eb2010-09-02 23:53:26313
[email protected]154cbabd2011-02-17 23:01:57314 BrowserThread::PostTask(
315 BrowserThread::FILE, FROM_HERE,
316 NewRunnableMethod(this,
317 &CrashHandlerHostLinux::WriteDumpFile,
318 info,
319 crashing_pid,
[email protected]c468f9492011-04-15 20:56:37320 crash_context,
[email protected]154cbabd2011-02-17 23:01:57321 signal_fd));
322}
323
324void CrashHandlerHostLinux::WriteDumpFile(BreakpadInfo* info,
325 pid_t crashing_pid,
326 char* crash_context,
327 int signal_fd) {
328 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
329
330 FilePath dumps_path("/tmp");
331 PathService::Get(base::DIR_TEMP, &dumps_path);
332 if (!info->upload)
333 PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path);
334 const uint64 rand = base::RandUint64();
335 const std::string minidump_filename =
336 StringPrintf("%s/chromium-%s-minidump-%016" PRIx64 ".dmp",
337 dumps_path.value().c_str(), process_type_.c_str(), rand);
338 if (!google_breakpad::WriteMinidump(minidump_filename.c_str(),
339 crashing_pid, crash_context,
340 kCrashContextSize)) {
341 LOG(ERROR) << "Failed to write crash dump for pid " << crashing_pid;
342 }
[email protected]c468f9492011-04-15 20:56:37343 delete[] crash_context;
[email protected]154cbabd2011-02-17 23:01:57344
[email protected]c468f9492011-04-15 20:56:37345 // Freed in CrashDumpTask();
[email protected]154cbabd2011-02-17 23:01:57346 char* minidump_filename_str = new char[minidump_filename.length() + 1];
347 minidump_filename.copy(minidump_filename_str, minidump_filename.length());
348 minidump_filename_str[minidump_filename.length()] = '\0';
349 info->filename = minidump_filename_str;
350
351 BrowserThread::PostTask(
352 BrowserThread::IO, FROM_HERE,
353 NewRunnableMethod(this,
354 &CrashHandlerHostLinux::QueueCrashDumpTask,
355 info,
356 signal_fd));
357}
358
359void CrashHandlerHostLinux::QueueCrashDumpTask(BreakpadInfo* info,
360 int signal_fd) {
361 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
362
363 // Send the done signal to the process: it can exit now.
364 struct msghdr msg = {0};
365 struct iovec done_iov;
366 done_iov.iov_base = const_cast<char*>("\x42");
367 done_iov.iov_len = 1;
368 msg.msg_iov = &done_iov;
369 msg.msg_iovlen = 1;
370
371 HANDLE_EINTR(sendmsg(signal_fd, &msg, MSG_DONTWAIT | MSG_NOSIGNAL));
372 HANDLE_EINTR(close(signal_fd));
373
[email protected]b064f0eb2010-09-02 23:53:26374 uploader_thread_->message_loop()->PostTask(
375 FROM_HERE,
[email protected]ca779662010-11-11 23:28:43376 NewRunnableFunction(&CrashDumpTask, this, info));
[email protected]9a5d2a52009-05-22 03:37:45377}
378
[email protected]2456c572009-11-09 04:21:51379void CrashHandlerHostLinux::WillDestroyCurrentMessageLoop() {
[email protected]9a5d2a52009-05-22 03:37:45380 file_descriptor_watcher_.StopWatchingFileDescriptor();
[email protected]ca779662010-11-11 23:28:43381
382 // If we are quitting and there are crash dumps in the queue, turn them into
383 // no-ops.
384 shutting_down_ = true;
385 uploader_thread_->Stop();
386}
387
388bool CrashHandlerHostLinux::IsShuttingDown() const {
389 return shutting_down_;
[email protected]9a5d2a52009-05-22 03:37:45390}
[email protected]b064f0eb2010-09-02 23:53:26391
[email protected]9dbfff12011-07-01 19:37:07392ExtensionCrashHandlerHostLinux::ExtensionCrashHandlerHostLinux() {
393 InitCrashUploaderThread();
394}
395
396ExtensionCrashHandlerHostLinux::~ExtensionCrashHandlerHostLinux() {
397}
398
399void ExtensionCrashHandlerHostLinux::SetProcessType() {
400 process_type_ = "extension";
401}
402
403// static
404ExtensionCrashHandlerHostLinux* ExtensionCrashHandlerHostLinux::GetInstance() {
405 return Singleton<ExtensionCrashHandlerHostLinux>::get();
406}
407
[email protected]9289af822011-02-03 18:21:20408GpuCrashHandlerHostLinux::GpuCrashHandlerHostLinux() {
409 InitCrashUploaderThread();
410}
411
412GpuCrashHandlerHostLinux::~GpuCrashHandlerHostLinux() {
413}
414
415void GpuCrashHandlerHostLinux::SetProcessType() {
416 process_type_ = "gpu-process";
417}
418
419// static
420GpuCrashHandlerHostLinux* GpuCrashHandlerHostLinux::GetInstance() {
421 return Singleton<GpuCrashHandlerHostLinux>::get();
422}
423
[email protected]b064f0eb2010-09-02 23:53:26424PluginCrashHandlerHostLinux::PluginCrashHandlerHostLinux() {
[email protected]19eef062010-09-16 19:44:09425 InitCrashUploaderThread();
[email protected]b064f0eb2010-09-02 23:53:26426}
427
428PluginCrashHandlerHostLinux::~PluginCrashHandlerHostLinux() {
429}
430
431void PluginCrashHandlerHostLinux::SetProcessType() {
432 process_type_ = "plugin";
433}
434
[email protected]d3c6c0d72010-12-09 08:15:04435// static
436PluginCrashHandlerHostLinux* PluginCrashHandlerHostLinux::GetInstance() {
437 return Singleton<PluginCrashHandlerHostLinux>::get();
438}
439
[email protected]54457f32011-04-15 22:05:29440PpapiCrashHandlerHostLinux::PpapiCrashHandlerHostLinux() {
441 InitCrashUploaderThread();
442}
443
444PpapiCrashHandlerHostLinux::~PpapiCrashHandlerHostLinux() {
445}
446
447void PpapiCrashHandlerHostLinux::SetProcessType() {
448 process_type_ = "ppapi";
449}
450
451// static
452PpapiCrashHandlerHostLinux* PpapiCrashHandlerHostLinux::GetInstance() {
453 return Singleton<PpapiCrashHandlerHostLinux>::get();
454}
[email protected]9dbfff12011-07-01 19:37:07455
456RendererCrashHandlerHostLinux::RendererCrashHandlerHostLinux() {
457 InitCrashUploaderThread();
458}
459
460RendererCrashHandlerHostLinux::~RendererCrashHandlerHostLinux() {
461}
462
463void RendererCrashHandlerHostLinux::SetProcessType() {
464 process_type_ = "renderer";
465}
466
467// static
468RendererCrashHandlerHostLinux* RendererCrashHandlerHostLinux::GetInstance() {
469 return Singleton<RendererCrashHandlerHostLinux>::get();
470}