| 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 "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  Loading... | 
| 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  Loading... | 
| 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 | 
| OLD | NEW | 
|---|