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 // On Windows chrome_elf registers crash keys. This should work identically | 231 #if !defined(OS_WIN) || !defined(COMPONENT_BUILD) |
232 // for component and non component builds. | 232 // chrome/common/child_process_logging_win.cc registers crash keys for |
| 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. |
233 base::debug::SetCrashKeyReportingFunctions(SetCrashKeyValue, ClearCrashKey); | 237 base::debug::SetCrashKeyReportingFunctions(SetCrashKeyValue, ClearCrashKey); |
234 crash_reporter_client->RegisterCrashKeys(); | 238 crash_reporter_client->RegisterCrashKeys(); |
| 239 #endif |
235 | 240 |
236 SetCrashKeyValue("ptype", browser_process ? base::StringPiece("browser") | 241 SetCrashKeyValue("ptype", browser_process ? base::StringPiece("browser") |
237 : base::StringPiece(process_type)); | 242 : base::StringPiece(process_type)); |
238 #if defined(OS_POSIX) | 243 #if defined(OS_POSIX) |
239 SetCrashKeyValue("pid", base::IntToString(getpid())); | 244 SetCrashKeyValue("pid", base::IntToString(getpid())); |
240 #elif defined(OS_WIN) | 245 #elif defined(OS_WIN) |
241 SetCrashKeyValue("pid", base::IntToString(::GetCurrentProcessId())); | 246 SetCrashKeyValue("pid", base::IntToString(::GetCurrentProcessId())); |
242 #endif | 247 #endif |
243 | 248 |
244 logging::SetLogMessageHandler(LogMessageHandler); | 249 logging::SetLogMessageHandler(LogMessageHandler); |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 base::UTF16ToUTF8(value)); | 475 base::UTF16ToUTF8(value)); |
471 } | 476 } |
472 | 477 |
473 void __declspec(dllexport) __cdecl ClearCrashKeyValueImpl(const wchar_t* key) { | 478 void __declspec(dllexport) __cdecl ClearCrashKeyValueImpl(const wchar_t* key) { |
474 crash_reporter::ClearCrashKey(base::UTF16ToUTF8(key)); | 479 crash_reporter::ClearCrashKey(base::UTF16ToUTF8(key)); |
475 } | 480 } |
476 | 481 |
477 } // extern "C" | 482 } // extern "C" |
478 | 483 |
479 #endif // OS_WIN | 484 #endif // OS_WIN |
OLD | NEW |