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

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 some old setters. 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 sanitizationInfo;
160 sanitizationInfo.should_sanitize_dumps = true;
161 sanitizationInfo.skip_dump_if_principal_mapping_not_referenced = false;
Torne 2017/02/15 11:45:13 Can you make this line part of an #if/#else instea
gsennton 2017/02/15 17:26:42 Done.
160 #if !defined(COMPONENT_BUILD) 162 #if !defined(COMPONENT_BUILD)
161 breakpad::SetSkipDumpIfPrincipalMappingNotReferenced( 163 sanitizationInfo.skip_dump_if_principal_mapping_not_referenced = true;
162 reinterpret_cast<uintptr_t>(&EnableCrashReporter)); 164 sanitizationInfo.address_within_principal_mapping =
165 reinterpret_cast<uintptr_t>(&EnableCrashReporter);
163 #endif 166 #endif
164 167
165 bool is_browser_process = 168 bool is_browser_process =
166 process_type.empty() || 169 process_type.empty() ||
167 process_type == breakpad::kWebViewSingleProcessType || 170 process_type == breakpad::kWebViewSingleProcessType ||
168 process_type == breakpad::kBrowserProcessType; 171 process_type == breakpad::kBrowserProcessType;
169 if (is_browser_process) { 172 if (is_browser_process) {
170 breakpad::InitCrashReporter(""); 173 breakpad::InitCrashReporter("", sanitizationInfo);
171 } else { 174 } else {
172 breakpad::InitNonBrowserCrashReporterForAndroid(process_type); 175 breakpad::InitNonBrowserCrashReporterForAndroid(process_type,
176 sanitizationInfo);
173 } 177 }
174 g_enabled = true; 178 g_enabled = true;
175 } 179 }
176 180
177 bool GetCrashDumpLocation(base::FilePath* crash_dir) { 181 bool GetCrashDumpLocation(base::FilePath* crash_dir) {
178 return g_crash_reporter_client.Get().GetCrashDumpLocation(crash_dir); 182 return g_crash_reporter_client.Get().GetCrashDumpLocation(crash_dir);
179 } 183 }
180 184
181 void AddGpuFingerprintToMicrodumpCrashHandler( 185 void AddGpuFingerprintToMicrodumpCrashHandler(
182 const std::string& gpu_fingerprint) { 186 const std::string& gpu_fingerprint) {
183 breakpad::AddGpuFingerprintToMicrodumpCrashHandler(gpu_fingerprint); 187 breakpad::AddGpuFingerprintToMicrodumpCrashHandler(gpu_fingerprint);
184 } 188 }
185 189
186 bool DumpWithoutCrashingToFd(int fd) { 190 bool DumpWithoutCrashingToFd(int fd) {
187 return g_crash_reporter_client.Pointer()->DumpWithoutCrashingToFd(fd); 191 return g_crash_reporter_client.Pointer()->DumpWithoutCrashingToFd(fd);
188 } 192 }
189 193
190 bool IsCrashReporterEnabled() { 194 bool IsCrashReporterEnabled() {
191 return breakpad::IsCrashReporterEnabled(); 195 return breakpad::IsCrashReporterEnabled();
192 } 196 }
193 197
194 void SuppressDumpGeneration() { 198 void SuppressDumpGeneration() {
195 breakpad::SuppressDumpGeneration(); 199 breakpad::SuppressDumpGeneration();
196 } 200 }
197 201
198 } // namespace crash_reporter 202 } // namespace crash_reporter
199 } // namespace android_webview 203 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698