| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // TODO(ananta/scottmg) | 5 // TODO(ananta/scottmg) |
| 6 // Add test coverage for Crashpad. | 6 // Add test coverage for Crashpad. |
| 7 #include "chrome/app/chrome_crash_reporter_client_win.h" | 7 #include "chrome/app/chrome_crash_reporter_client_win.h" |
| 8 | 8 |
| 9 #include <assert.h> | 9 #include <assert.h> |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 void ChromeCrashReporterClient::InitializeCrashReportingForProcess() { | 247 void ChromeCrashReporterClient::InitializeCrashReportingForProcess() { |
| 248 static ChromeCrashReporterClient* instance = nullptr; | 248 static ChromeCrashReporterClient* instance = nullptr; |
| 249 if (instance) | 249 if (instance) |
| 250 return; | 250 return; |
| 251 | 251 |
| 252 instance = new ChromeCrashReporterClient(); | 252 instance = new ChromeCrashReporterClient(); |
| 253 ANNOTATE_LEAKING_OBJECT_PTR(instance); | 253 ANNOTATE_LEAKING_OBJECT_PTR(instance); |
| 254 | 254 |
| 255 std::wstring process_type = install_static::GetSwitchValueFromCommandLine( | 255 std::wstring process_type = install_static::GetSwitchValueFromCommandLine( |
| 256 ::GetCommandLine(), install_static::kProcessType); | 256 ::GetCommandLine(), install_static::kProcessType); |
| 257 if (process_type != install_static::kCrashpadHandler) { | 257 // Don't set up Crashpad crash reporting in the Crashpad handler itself, nor |
| 258 // in the fallback crash handler for the Crashpad handler process. |
| 259 if (process_type != install_static::kCrashpadHandler && |
| 260 process_type != install_static::kFallbackHandler) { |
| 258 crash_reporter::SetCrashReporterClient(instance); | 261 crash_reporter::SetCrashReporterClient(instance); |
| 259 crash_reporter::InitializeCrashpadWithEmbeddedHandler( | 262 crash_reporter::InitializeCrashpadWithEmbeddedHandler( |
| 260 process_type.empty(), install_static::UTF16ToUTF8(process_type)); | 263 process_type.empty(), install_static::UTF16ToUTF8(process_type)); |
| 261 } | 264 } |
| 262 } | 265 } |
| 263 #endif // NACL_WIN64 | 266 #endif // NACL_WIN64 |
| 264 | 267 |
| 265 bool ChromeCrashReporterClient::GetAlternativeCrashDumpLocation( | 268 bool ChromeCrashReporterClient::GetAlternativeCrashDumpLocation( |
| 266 base::string16* crash_dir) { | 269 base::string16* crash_dir) { |
| 267 // By setting the BREAKPAD_DUMP_LOCATION environment variable, an alternate | 270 // By setting the BREAKPAD_DUMP_LOCATION environment variable, an alternate |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 bool ChromeCrashReporterClient::GetCollectStatsInSample() { | 400 bool ChromeCrashReporterClient::GetCollectStatsInSample() { |
| 398 return install_static::GetCollectStatsInSample(); | 401 return install_static::GetCollectStatsInSample(); |
| 399 } | 402 } |
| 400 | 403 |
| 401 bool ChromeCrashReporterClient::EnableBreakpadForProcess( | 404 bool ChromeCrashReporterClient::EnableBreakpadForProcess( |
| 402 const std::string& process_type) { | 405 const std::string& process_type) { |
| 403 // This is not used by Crashpad (at least on Windows). | 406 // This is not used by Crashpad (at least on Windows). |
| 404 NOTREACHED(); | 407 NOTREACHED(); |
| 405 return true; | 408 return true; |
| 406 } | 409 } |
| OLD | NEW |