Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/app/breakpad_win.h" | 5 #include "chrome/app/breakpad_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 #include <tchar.h> | 9 #include <tchar.h> |
| 10 | 10 |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 512 bool use_crash_service = !controlled_by_policy && | 512 bool use_crash_service = !controlled_by_policy && |
| 513 ((command.HasSwitch(switches::kNoErrorDialogs) || | 513 ((command.HasSwitch(switches::kNoErrorDialogs) || |
| 514 GetEnvironmentVariable( | 514 GetEnvironmentVariable( |
| 515 ASCIIToWide(env_vars::kHeadless).c_str(), NULL, 0))); | 515 ASCIIToWide(env_vars::kHeadless).c_str(), NULL, 0))); |
| 516 bool is_per_user_install = | 516 bool is_per_user_install = |
| 517 InstallUtil::IsPerUserInstall(info->dll_path.c_str()); | 517 InstallUtil::IsPerUserInstall(info->dll_path.c_str()); |
| 518 | 518 |
| 519 std::wstring pipe_name; | 519 std::wstring pipe_name; |
| 520 if (use_crash_service) { | 520 if (use_crash_service) { |
| 521 // Crash reporting is done by crash_service.exe. | 521 // Crash reporting is done by crash_service.exe. |
| 522 pipe_name = kChromePipeName; | 522 const char* env_var = getenv("CHROME_BREAKPAD_PIPE_NAME"); |
| 523 if (env_var != NULL) { | |
|
cpu_(ooo_6.6-7.5)
2011/08/03 22:38:48
please use GetEnvironmentVariable() which returns
| |
| 524 pipe_name = std::wstring(env_var, env_var + strlen(env_var)); | |
| 525 } else { | |
| 526 pipe_name = kChromePipeName; | |
| 527 } | |
| 523 } else { | 528 } else { |
| 524 // We want to use the Google Update crash reporting. We need to check if the | 529 // We want to use the Google Update crash reporting. We need to check if the |
| 525 // user allows it first (in case the administrator didn't already decide | 530 // user allows it first (in case the administrator didn't already decide |
| 526 // via policy). | 531 // via policy). |
| 527 if (!controlled_by_policy) | 532 if (!controlled_by_policy) |
| 528 crash_reporting_enabled = GoogleUpdateSettings::GetCollectStatsConsent(); | 533 crash_reporting_enabled = GoogleUpdateSettings::GetCollectStatsConsent(); |
| 529 | 534 |
| 530 if (!crash_reporting_enabled) { | 535 if (!crash_reporting_enabled) { |
| 531 // Configuration managed or the user did not allow Google Update to send | 536 // Configuration managed or the user did not allow Google Update to send |
| 532 // crashes, we need to use our default crash handler instead, but only | 537 // crashes, we need to use our default crash handler instead, but only |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 621 if (QueueUserWorkItem( | 626 if (QueueUserWorkItem( |
| 622 &InitCrashReporterThread, | 627 &InitCrashReporterThread, |
| 623 info, | 628 info, |
| 624 WT_EXECUTELONGFUNCTION) == 0) { | 629 WT_EXECUTELONGFUNCTION) == 0) { |
| 625 // We failed to queue to the worker pool, initialize in this thread. | 630 // We failed to queue to the worker pool, initialize in this thread. |
| 626 InitCrashReporterThread(info); | 631 InitCrashReporterThread(info); |
| 627 } | 632 } |
| 628 } | 633 } |
| 629 } | 634 } |
| 630 } | 635 } |
| OLD | NEW |