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

Side by Side Diff: components/crash/content/app/crashpad.cc

Issue 2114533002: Switch chrome_elf exception handling from breakpad to crashpad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add dependencies on the chrome_elf_common target in the blacklist target. Previously this came in i… Created 4 years, 5 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
« no previous file with comments | « chrome_elf/chrome_elf_main.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/crash/content/app/crashpad.h" 5 #include "components/crash/content/app/crashpad.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #if BUILDFLAG(ENABLE_KASKO) 10 #if BUILDFLAG(ENABLE_KASKO)
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 // time to chew on symbols. 221 // time to chew on symbols.
222 if (!browser_process || is_debug_build) { 222 if (!browser_process || is_debug_build) {
223 crashpad_info->set_system_crash_reporter_forwarding( 223 crashpad_info->set_system_crash_reporter_forwarding(
224 crashpad::TriState::kDisabled); 224 crashpad::TriState::kDisabled);
225 } 225 }
226 #endif // OS_MACOSX 226 #endif // OS_MACOSX
227 227
228 g_simple_string_dictionary = new crashpad::SimpleStringDictionary(); 228 g_simple_string_dictionary = new crashpad::SimpleStringDictionary();
229 crashpad_info->set_simple_annotations(g_simple_string_dictionary); 229 crashpad_info->set_simple_annotations(g_simple_string_dictionary);
230 230
231 #if !defined(OS_WIN) || !defined(COMPONENT_BUILD) 231 // On Windows chrome_elf registers crash keys. This should work identically
232 // chrome/common/child_process_logging_win.cc registers crash keys for 232 // for component and non component builds.
233 // chrome.dll. In a component build, that is sufficient as chrome.dll and
234 // chrome.exe share a copy of base (in base.dll). In a static build, the EXE
235 // must separately initialize the crash keys configuration as it has its own
236 // statically linked copy of base.
237 base::debug::SetCrashKeyReportingFunctions(SetCrashKeyValue, ClearCrashKey); 233 base::debug::SetCrashKeyReportingFunctions(SetCrashKeyValue, ClearCrashKey);
238 crash_reporter_client->RegisterCrashKeys(); 234 crash_reporter_client->RegisterCrashKeys();
239 #endif
240 235
241 SetCrashKeyValue("ptype", browser_process ? base::StringPiece("browser") 236 SetCrashKeyValue("ptype", browser_process ? base::StringPiece("browser")
242 : base::StringPiece(process_type)); 237 : base::StringPiece(process_type));
243 #if defined(OS_POSIX) 238 #if defined(OS_POSIX)
244 SetCrashKeyValue("pid", base::IntToString(getpid())); 239 SetCrashKeyValue("pid", base::IntToString(getpid()));
245 #elif defined(OS_WIN) 240 #elif defined(OS_WIN)
246 SetCrashKeyValue("pid", base::IntToString(::GetCurrentProcessId())); 241 SetCrashKeyValue("pid", base::IntToString(::GetCurrentProcessId()));
247 #endif 242 #endif
248 243
249 logging::SetLogMessageHandler(LogMessageHandler); 244 logging::SetLogMessageHandler(LogMessageHandler);
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 base::UTF16ToUTF8(value)); 470 base::UTF16ToUTF8(value));
476 } 471 }
477 472
478 void __declspec(dllexport) __cdecl ClearCrashKeyValueImpl(const wchar_t* key) { 473 void __declspec(dllexport) __cdecl ClearCrashKeyValueImpl(const wchar_t* key) {
479 crash_reporter::ClearCrashKey(base::UTF16ToUTF8(key)); 474 crash_reporter::ClearCrashKey(base::UTF16ToUTF8(key));
480 } 475 }
481 476
482 } // extern "C" 477 } // extern "C"
483 478
484 #endif // OS_WIN 479 #endif // OS_WIN
OLDNEW
« no previous file with comments | « chrome_elf/chrome_elf_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698