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 // For linux_syscall_support.h. This makes it safe to call embedded system | 5 // For linux_syscall_support.h. This makes it safe to call embedded system |
6 // calls when in seccomp mode. | 6 // calls when in seccomp mode. |
7 | 7 |
8 #include "components/crash/app/breakpad_linux.h" | 8 #include "components/crash/app/breakpad_linux.h" |
9 | 9 |
10 #include <fcntl.h> | 10 #include <fcntl.h> |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 } | 750 } |
751 #else | 751 #else |
752 // Non-Browser = Extension, Gpu, Plugins, Ppapi and Renderer | 752 // Non-Browser = Extension, Gpu, Plugins, Ppapi and Renderer |
753 class NonBrowserCrashHandler : public google_breakpad::CrashGenerationClient { | 753 class NonBrowserCrashHandler : public google_breakpad::CrashGenerationClient { |
754 public: | 754 public: |
755 NonBrowserCrashHandler() | 755 NonBrowserCrashHandler() |
756 : server_fd_(base::GlobalDescriptors::GetInstance()->Get( | 756 : server_fd_(base::GlobalDescriptors::GetInstance()->Get( |
757 kCrashDumpSignal)) { | 757 kCrashDumpSignal)) { |
758 } | 758 } |
759 | 759 |
760 virtual ~NonBrowserCrashHandler() {} | 760 ~NonBrowserCrashHandler() override {} |
761 | 761 |
762 virtual bool RequestDump(const void* crash_context, | 762 bool RequestDump(const void* crash_context, |
763 size_t crash_context_size) override { | 763 size_t crash_context_size) override { |
764 int fds[2] = { -1, -1 }; | 764 int fds[2] = { -1, -1 }; |
765 if (sys_socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) { | 765 if (sys_socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) { |
766 static const char msg[] = "Failed to create socket for crash dumping.\n"; | 766 static const char msg[] = "Failed to create socket for crash dumping.\n"; |
767 WriteLog(msg, sizeof(msg) - 1); | 767 WriteLog(msg, sizeof(msg) - 1); |
768 return false; | 768 return false; |
769 } | 769 } |
770 | 770 |
771 // Start constructing the message to send to the browser. | 771 // Start constructing the message to send to the browser. |
772 char b; // Dummy variable for sys_read below. | 772 char b; // Dummy variable for sys_read below. |
773 const char* b_addr = &b; // Get the address of |b| so we can create the | 773 const char* b_addr = &b; // Get the address of |b| so we can create the |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1639 } | 1639 } |
1640 } | 1640 } |
1641 } | 1641 } |
1642 #endif // OS_ANDROID | 1642 #endif // OS_ANDROID |
1643 | 1643 |
1644 bool IsCrashReporterEnabled() { | 1644 bool IsCrashReporterEnabled() { |
1645 return g_is_crash_reporter_enabled; | 1645 return g_is_crash_reporter_enabled; |
1646 } | 1646 } |
1647 | 1647 |
1648 } // namespace breakpad | 1648 } // namespace breakpad |
OLD | NEW |