OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "components/crash/browser/crash_handler_host_linux.h" | 5 #include "components/crash/browser/crash_handler_host_linux.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <sys/socket.h> | 9 #include <sys/socket.h> |
10 #include <sys/syscall.h> | 10 #include <sys/syscall.h> |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 BrowserThread::PostTask( | 395 BrowserThread::PostTask( |
396 BrowserThread::IO, FROM_HERE, | 396 BrowserThread::IO, FROM_HERE, |
397 base::Bind(&CrashHandlerHostLinux::QueueCrashDumpTask, | 397 base::Bind(&CrashHandlerHostLinux::QueueCrashDumpTask, |
398 base::Unretained(this), | 398 base::Unretained(this), |
399 base::Passed(&info), | 399 base::Passed(&info), |
400 signal_fd)); | 400 signal_fd)); |
401 } | 401 } |
402 | 402 |
403 void CrashHandlerHostLinux::QueueCrashDumpTask(scoped_ptr<BreakpadInfo> info, | 403 void CrashHandlerHostLinux::QueueCrashDumpTask(scoped_ptr<BreakpadInfo> info, |
404 int signal_fd) { | 404 int signal_fd) { |
405 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 405 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
406 | 406 |
407 // Send the done signal to the process: it can exit now. | 407 // Send the done signal to the process: it can exit now. |
408 struct msghdr msg = {0}; | 408 struct msghdr msg = {0}; |
409 struct iovec done_iov; | 409 struct iovec done_iov; |
410 done_iov.iov_base = const_cast<char*>("\x42"); | 410 done_iov.iov_base = const_cast<char*>("\x42"); |
411 done_iov.iov_len = 1; | 411 done_iov.iov_len = 1; |
412 msg.msg_iov = &done_iov; | 412 msg.msg_iov = &done_iov; |
413 msg.msg_iovlen = 1; | 413 msg.msg_iovlen = 1; |
414 | 414 |
415 HANDLE_EINTR(sendmsg(signal_fd, &msg, MSG_DONTWAIT | MSG_NOSIGNAL)); | 415 HANDLE_EINTR(sendmsg(signal_fd, &msg, MSG_DONTWAIT | MSG_NOSIGNAL)); |
(...skipping 11 matching lines...) Expand all Loading... |
427 // no-ops. | 427 // no-ops. |
428 shutting_down_ = true; | 428 shutting_down_ = true; |
429 uploader_thread_->Stop(); | 429 uploader_thread_->Stop(); |
430 } | 430 } |
431 | 431 |
432 bool CrashHandlerHostLinux::IsShuttingDown() const { | 432 bool CrashHandlerHostLinux::IsShuttingDown() const { |
433 return shutting_down_; | 433 return shutting_down_; |
434 } | 434 } |
435 | 435 |
436 } // namespace breakpad | 436 } // namespace breakpad |
OLD | NEW |