Chromium Code Reviews| Index: chrome/app/chrome_crash_reporter_client_win.cc |
| diff --git a/chrome/app/chrome_crash_reporter_client_win.cc b/chrome/app/chrome_crash_reporter_client_win.cc |
| index 42e2093efa73d2506a45a87d0b89b2b4cc974dc0..61197252af72d76c843705eaec3e8a54595f3dc9 100644 |
| --- a/chrome/app/chrome_crash_reporter_client_win.cc |
| +++ b/chrome/app/chrome_crash_reporter_client_win.cc |
| @@ -69,6 +69,12 @@ int snprintf(char* buffer, |
| } |
| size_t RegisterCrashKeysHelper() { |
| + // Crash keys should be registered only once for the duration of the |
|
scottmg
2016/06/27 19:37:46
Why is this getting called multiple times now?
ananta
2016/06/27 20:00:26
Can get called from child_process_logging_win.cc w
|
| + // process. |
| + static size_t registered_keys_size = 0; |
| + if (registered_keys_size) |
| + return registered_keys_size; |
| + |
| // The following keys may be chunked by the underlying crash logging system, |
| // but ultimately constitute a single key-value pair. |
| // |
| @@ -172,7 +178,9 @@ size_t RegisterCrashKeysHelper() { |
| } |
| } |
| - return base::debug::InitCrashKeys(&keys[0], keys.size(), kChunkMaxLength); |
| + registered_keys_size = |
| + base::debug::InitCrashKeys(&keys[0], keys.size(), kChunkMaxLength); |
| + return registered_keys_size; |
| } |
| } // namespace |
| @@ -201,6 +209,11 @@ void ChromeCrashReporterClient::InitializeCrashReportingForProcess() { |
| } |
| #endif // NACL_WIN64 |
| +// static |
| +void ChromeCrashReporterClient::RegisterCrashKeysForDebugging() { |
| + RegisterCrashKeysHelper(); |
| +} |
| + |
| bool ChromeCrashReporterClient::GetAlternativeCrashDumpLocation( |
| base::string16* crash_dir) { |
| // By setting the BREAKPAD_DUMP_LOCATION environment variable, an alternate |