| 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 "android_webview/common/aw_version_info_values.h" | 7 #include "android_webview/common/aw_version_info_values.h" |
| 8 #include "base/debug/dump_without_crashing.h" | 8 #include "base/debug/dump_without_crashing.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 return true; | 102 return true; |
| 103 } else { | 103 } else { |
| 104 DLOG(WARNING) << "Native bridge ver=" << version << "; too low"; | 104 DLOG(WARNING) << "Native bridge ver=" << version << "; too low"; |
| 105 return false; | 105 return false; |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 #endif | 108 #endif |
| 109 | 109 |
| 110 } // namespace | 110 } // namespace |
| 111 | 111 |
| 112 void EnableMicrodumpCrashReporter() { | 112 void EnableMicrodumpCrashReporter(const std::string& process_type) { |
| 113 if (g_enabled) { | 113 if (g_enabled) { |
| 114 NOTREACHED() << "EnableMicrodumpCrashReporter called more than once"; | 114 NOTREACHED() << "EnableMicrodumpCrashReporter called more than once"; |
| 115 return; | 115 return; |
| 116 } | 116 } |
| 117 | 117 |
| 118 #if defined(ARCH_CPU_X86_FAMILY) | 118 #if defined(ARCH_CPU_X86_FAMILY) |
| 119 if (!SafeToUseSignalHandler()) { | 119 if (!SafeToUseSignalHandler()) { |
| 120 LOG(WARNING) << "Can't use breakpad to handle WebView crashes"; | 120 LOG(WARNING) << "Can't use breakpad to handle WebView crashes"; |
| 121 return; | 121 return; |
| 122 } | 122 } |
| 123 #endif | 123 #endif |
| 124 | 124 |
| 125 ::crash_reporter::SetCrashReporterClient(g_crash_reporter_client.Pointer()); | 125 ::crash_reporter::SetCrashReporterClient(g_crash_reporter_client.Pointer()); |
| 126 | 126 |
| 127 // |process_type| is not really relevant here, as long as it not empty. | 127 breakpad::InitMicrodumpCrashHandlerIfNecessary(process_type); |
| 128 breakpad::InitNonBrowserCrashReporterForAndroid("webview" /* process_type */); | |
| 129 g_enabled = true; | 128 g_enabled = true; |
| 130 } | 129 } |
| 131 | 130 |
| 132 void AddGpuFingerprintToMicrodumpCrashHandler( | 131 void AddGpuFingerprintToMicrodumpCrashHandler( |
| 133 const std::string& gpu_fingerprint) { | 132 const std::string& gpu_fingerprint) { |
| 134 breakpad::AddGpuFingerprintToMicrodumpCrashHandler(gpu_fingerprint); | 133 breakpad::AddGpuFingerprintToMicrodumpCrashHandler(gpu_fingerprint); |
| 135 } | 134 } |
| 136 | 135 |
| 137 bool DumpWithoutCrashingToFd(int fd) { | 136 bool DumpWithoutCrashingToFd(int fd) { |
| 138 return g_crash_reporter_client.Pointer()->DumpWithoutCrashingToFd(fd); | 137 return g_crash_reporter_client.Pointer()->DumpWithoutCrashingToFd(fd); |
| 139 } | 138 } |
| 140 | 139 |
| 141 } // namespace crash_reporter | 140 } // namespace crash_reporter |
| 142 } // namespace android_webview | 141 } // namespace android_webview |
| OLD | NEW |