Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Side by Side Diff: android_webview/common/crash_reporter/aw_microdump_crash_reporter.cc

Issue 2694083004: Fix minidump-generation for debug builds. (Closed)
Patch Set: Remove unused fields from MinidumpInfo. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/common/crash_reporter/aw_microdump_crash_reporter.h" 5 #include "android_webview/common/crash_reporter/aw_microdump_crash_reporter.h"
6 6
7 #include "android_webview/common/aw_descriptors.h" 7 #include "android_webview/common/aw_descriptors.h"
8 #include "android_webview/common/aw_paths.h" 8 #include "android_webview/common/aw_paths.h"
9 #include "android_webview/common/aw_version_info_values.h" 9 #include "android_webview/common/aw_version_info_values.h"
10 #include "android_webview/common/crash_reporter/crash_keys.h" 10 #include "android_webview/common/crash_reporter/crash_keys.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 LOG(WARNING) << "Can't use breakpad to handle WebView crashes"; 149 LOG(WARNING) << "Can't use breakpad to handle WebView crashes";
150 return; 150 return;
151 } 151 }
152 #endif 152 #endif
153 153
154 AwCrashReporterClient* client = g_crash_reporter_client.Pointer(); 154 AwCrashReporterClient* client = g_crash_reporter_client.Pointer();
155 if (process_type == switches::kRendererProcess && crash_signal_fd != -1) { 155 if (process_type == switches::kRendererProcess && crash_signal_fd != -1) {
156 client->set_crash_signal_fd(crash_signal_fd); 156 client->set_crash_signal_fd(crash_signal_fd);
157 } 157 }
158 ::crash_reporter::SetCrashReporterClient(client); 158 ::crash_reporter::SetCrashReporterClient(client);
159 breakpad::SetShouldSanitizeDumps(true); 159 breakpad::SanitizationInfo sanitization_info;
160 #if !defined(COMPONENT_BUILD) 160 sanitization_info.should_sanitize_dumps = true;
161 breakpad::SetSkipDumpIfPrincipalMappingNotReferenced( 161 #if defined(COMPONENT_BUILD)
162 reinterpret_cast<uintptr_t>(&EnableCrashReporter)); 162 sanitization_info.skip_dump_if_principal_mapping_not_referenced = false;
Primiano Tucci (use gerrit) 2017/02/15 18:39:07 there shouldn't be any need for this as false is t
gsennton 2017/02/16 10:46:49 Done.
163 #endif 163 #else
164 sanitization_info.skip_dump_if_principal_mapping_not_referenced = true;
165 sanitization_info.address_within_principal_mapping =
166 reinterpret_cast<uintptr_t>(&EnableCrashReporter);
167 #endif // defined(COMPONENT_BUILD)
164 168
165 bool is_browser_process = 169 bool is_browser_process =
166 process_type.empty() || 170 process_type.empty() ||
167 process_type == breakpad::kWebViewSingleProcessType || 171 process_type == breakpad::kWebViewSingleProcessType ||
168 process_type == breakpad::kBrowserProcessType; 172 process_type == breakpad::kBrowserProcessType;
169 if (is_browser_process) { 173 if (is_browser_process) {
170 breakpad::InitCrashReporter(""); 174 breakpad::InitCrashReporter("", sanitization_info);
171 } else { 175 } else {
172 breakpad::InitNonBrowserCrashReporterForAndroid(process_type); 176 breakpad::InitNonBrowserCrashReporterForAndroid(process_type,
177 sanitization_info);
173 } 178 }
174 g_enabled = true; 179 g_enabled = true;
175 } 180 }
176 181
177 bool GetCrashDumpLocation(base::FilePath* crash_dir) { 182 bool GetCrashDumpLocation(base::FilePath* crash_dir) {
178 return g_crash_reporter_client.Get().GetCrashDumpLocation(crash_dir); 183 return g_crash_reporter_client.Get().GetCrashDumpLocation(crash_dir);
179 } 184 }
180 185
181 void AddGpuFingerprintToMicrodumpCrashHandler( 186 void AddGpuFingerprintToMicrodumpCrashHandler(
182 const std::string& gpu_fingerprint) { 187 const std::string& gpu_fingerprint) {
183 breakpad::AddGpuFingerprintToMicrodumpCrashHandler(gpu_fingerprint); 188 breakpad::AddGpuFingerprintToMicrodumpCrashHandler(gpu_fingerprint);
184 } 189 }
185 190
186 bool DumpWithoutCrashingToFd(int fd) { 191 bool DumpWithoutCrashingToFd(int fd) {
187 return g_crash_reporter_client.Pointer()->DumpWithoutCrashingToFd(fd); 192 return g_crash_reporter_client.Pointer()->DumpWithoutCrashingToFd(fd);
188 } 193 }
189 194
190 bool IsCrashReporterEnabled() { 195 bool IsCrashReporterEnabled() {
191 return breakpad::IsCrashReporterEnabled(); 196 return breakpad::IsCrashReporterEnabled();
192 } 197 }
193 198
194 void SuppressDumpGeneration() { 199 void SuppressDumpGeneration() {
195 breakpad::SuppressDumpGeneration(); 200 breakpad::SuppressDumpGeneration();
196 } 201 }
197 202
198 } // namespace crash_reporter 203 } // namespace crash_reporter
199 } // namespace android_webview 204 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698