| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "android_webview/crash_reporter/aw_microdump_crash_reporter.h" | 5 #include "android_webview/crash_reporter/aw_microdump_crash_reporter.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "build/build_config.h" |
| 8 #include "components/crash/app/breakpad_linux.h" | 9 #include "components/crash/app/breakpad_linux.h" |
| 9 #include "components/crash/app/crash_reporter_client.h" | 10 #include "components/crash/app/crash_reporter_client.h" |
| 10 | 11 |
| 11 namespace android_webview { | 12 namespace android_webview { |
| 12 namespace crash_reporter { | 13 namespace crash_reporter { |
| 13 | 14 |
| 14 namespace { | 15 namespace { |
| 15 | 16 |
| 16 class AwCrashReporterClient : public ::crash_reporter::CrashReporterClient { | 17 class AwCrashReporterClient : public ::crash_reporter::CrashReporterClient { |
| 17 public: | 18 public: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 31 }; | 32 }; |
| 32 | 33 |
| 33 base::LazyInstance<AwCrashReporterClient>::Leaky g_crash_reporter_client = | 34 base::LazyInstance<AwCrashReporterClient>::Leaky g_crash_reporter_client = |
| 34 LAZY_INSTANCE_INITIALIZER; | 35 LAZY_INSTANCE_INITIALIZER; |
| 35 | 36 |
| 36 bool g_enabled = false; | 37 bool g_enabled = false; |
| 37 | 38 |
| 38 } // namespace | 39 } // namespace |
| 39 | 40 |
| 40 void EnableMicrodumpCrashReporter() { | 41 void EnableMicrodumpCrashReporter() { |
| 42 #if defined(ARCH_CPU_X86_FAMILY) |
| 43 // Don't install signal handler on X86/64 because this breaks binary |
| 44 // translators that handle SIGSEGV in userspace and get chained after our |
| 45 // handler. See crbug.com/477444 |
| 46 return; |
| 47 #endif |
| 48 |
| 41 if (g_enabled) { | 49 if (g_enabled) { |
| 42 NOTREACHED() << "EnableMicrodumpCrashReporter called more than once"; | 50 NOTREACHED() << "EnableMicrodumpCrashReporter called more than once"; |
| 43 return; | 51 return; |
| 44 } | 52 } |
| 45 | 53 |
| 46 ::crash_reporter::SetCrashReporterClient(g_crash_reporter_client.Pointer()); | 54 ::crash_reporter::SetCrashReporterClient(g_crash_reporter_client.Pointer()); |
| 47 | 55 |
| 48 // |process_type| is not really relevant here, as long as it not empty. | 56 // |process_type| is not really relevant here, as long as it not empty. |
| 49 breakpad::InitNonBrowserCrashReporterForAndroid("webview" /* process_type */); | 57 breakpad::InitNonBrowserCrashReporterForAndroid("webview" /* process_type */); |
| 50 g_enabled = true; | 58 g_enabled = true; |
| 51 } | 59 } |
| 52 | 60 |
| 53 } // namespace crash_reporter | 61 } // namespace crash_reporter |
| 54 } // namespace android_webview | 62 } // namespace android_webview |
| OLD | NEW |