| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/app/breakpad_linux.h" | 5 #include "chrome/app/breakpad_linux.h" |
| 6 | 6 |
| 7 #include <arpa/inet.h> | 7 #include <arpa/inet.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <netinet/in.h> | 9 #include <netinet/in.h> |
| 10 #include <stdlib.h> | 10 #include <stdlib.h> |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 namespace child_process_logging { | 569 namespace child_process_logging { |
| 570 extern std::string active_url; | 570 extern std::string active_url; |
| 571 } | 571 } |
| 572 | 572 |
| 573 static bool | 573 static bool |
| 574 RendererCrashHandler(const void* crash_context, size_t crash_context_size, | 574 RendererCrashHandler(const void* crash_context, size_t crash_context_size, |
| 575 void* context) { | 575 void* context) { |
| 576 const int fd = reinterpret_cast<intptr_t>(context); | 576 const int fd = reinterpret_cast<intptr_t>(context); |
| 577 int fds[2]; | 577 int fds[2]; |
| 578 socketpair(AF_UNIX, SOCK_STREAM, 0, fds); | 578 socketpair(AF_UNIX, SOCK_STREAM, 0, fds); |
| 579 char guid[kGuidSize] = {0}; | 579 char guid[kGuidSize + 1] = {0}; |
| 580 char crash_url[kMaxActiveURLSize + 1] = {0}; | 580 char crash_url[kMaxActiveURLSize + 1] = {0}; |
| 581 char distro[kDistroSize + 1] = {0}; | 581 char distro[kDistroSize + 1] = {0}; |
| 582 const size_t guid_len = std::min(google_update::linux_guid.size(), | 582 const size_t guid_len = std::min(google_update::linux_guid.size(), |
| 583 kGuidSize); | 583 kGuidSize); |
| 584 const size_t crash_url_len = | 584 const size_t crash_url_len = |
| 585 std::min(child_process_logging::active_url.size(), kMaxActiveURLSize); | 585 std::min(child_process_logging::active_url.size(), kMaxActiveURLSize); |
| 586 const size_t distro_len = | 586 const size_t distro_len = |
| 587 std::min(base::linux_distro.size(), kDistroSize); | 587 std::min(base::linux_distro.size(), kDistroSize); |
| 588 memcpy(guid, google_update::linux_guid.data(), guid_len); | 588 memcpy(guid, google_update::linux_guid.data(), guid_len); |
| 589 memcpy(crash_url, child_process_logging::active_url.data(), crash_url_len); | 589 memcpy(crash_url, child_process_logging::active_url.data(), crash_url_len); |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 | 820 |
| 821 if (WIFSIGNALED(status) && WCOREDUMP(status)) { | 821 if (WIFSIGNALED(status) && WCOREDUMP(status)) { |
| 822 std::string core_filename; | 822 std::string core_filename; |
| 823 UploadCoreFile(child, &core_filename); | 823 UploadCoreFile(child, &core_filename); |
| 824 unlink(core_filename.c_str()); | 824 unlink(core_filename.c_str()); |
| 825 } | 825 } |
| 826 | 826 |
| 827 rmdir(core_dump_directory.c_str()); | 827 rmdir(core_dump_directory.c_str()); |
| 828 } | 828 } |
| 829 #endif | 829 #endif |
| OLD | NEW |