| 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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 // Extend support to other architectures (requires some breakpad changes). | 723 // Extend support to other architectures (requires some breakpad changes). |
| 724 return; | 724 return; |
| 725 #endif | 725 #endif |
| 726 | 726 |
| 727 if (!GetCrashReporterClient()->ShouldEnableBreakpadMicrodumps()) | 727 if (!GetCrashReporterClient()->ShouldEnableBreakpadMicrodumps()) |
| 728 return; | 728 return; |
| 729 | 729 |
| 730 VLOG(1) << "Enabling microdumps crash handler (process_type:" | 730 VLOG(1) << "Enabling microdumps crash handler (process_type:" |
| 731 << process_type << ")"; | 731 << process_type << ")"; |
| 732 DCHECK(!g_microdump); | 732 DCHECK(!g_microdump); |
| 733 bool is_browser_process = process_type.empty() || process_type == "webview"; |
| 733 g_microdump = new ExceptionHandler( | 734 g_microdump = new ExceptionHandler( |
| 734 MinidumpDescriptor(MinidumpDescriptor::kMicrodumpOnConsole), | 735 MinidumpDescriptor(MinidumpDescriptor::kMicrodumpOnConsole), |
| 735 NULL, | 736 NULL, |
| 736 MicrodumpCrashDone, | 737 MicrodumpCrashDone, |
| 737 reinterpret_cast<void*>(process_type.empty()), | 738 reinterpret_cast<void*>(is_browser_process), |
| 738 true, // Install handlers. | 739 true, // Install handlers. |
| 739 -1); // Server file descriptor. -1 for in-process. | 740 -1); // Server file descriptor. -1 for in-process. |
| 740 return; | 741 return; |
| 741 } | 742 } |
| 742 | 743 |
| 743 bool CrashDoneInProcessNoUpload( | 744 bool CrashDoneInProcessNoUpload( |
| 744 const google_breakpad::MinidumpDescriptor& descriptor, | 745 const google_breakpad::MinidumpDescriptor& descriptor, |
| 745 void* context, | 746 void* context, |
| 746 const bool succeeded) { | 747 const bool succeeded) { |
| 747 // WARNING: this code runs in a compromised context. It may not call into | 748 // WARNING: this code runs in a compromised context. It may not call into |
| (...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1707 } | 1708 } |
| 1708 } | 1709 } |
| 1709 } | 1710 } |
| 1710 #endif // OS_ANDROID | 1711 #endif // OS_ANDROID |
| 1711 | 1712 |
| 1712 bool IsCrashReporterEnabled() { | 1713 bool IsCrashReporterEnabled() { |
| 1713 return g_is_crash_reporter_enabled; | 1714 return g_is_crash_reporter_enabled; |
| 1714 } | 1715 } |
| 1715 | 1716 |
| 1716 } // namespace breakpad | 1717 } // namespace breakpad |
| OLD | NEW |