Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: chrome/app/breakpad_win.cc

Issue 7538036: Windows Breakpad: Allow the crash dump dir and pipe name to be overridden (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix to use W version of GetEnvironmentVariable Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/tools/crash_service/crash_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 wchar_t* var_name = L"CHROME_BREAKPAD_PIPE_NAME";
523 DWORD value_length = ::GetEnvironmentVariableW(var_name, NULL, 0);
524 if (value_length == 0) {
525 pipe_name = kChromePipeName;
526 } else {
527 scoped_array<wchar_t> value(new wchar_t[value_length]);
528 ::GetEnvironmentVariableW(var_name, value.get(), value_length);
529 pipe_name = value.get();
530 }
523 } else { 531 } else {
524 // We want to use the Google Update crash reporting. We need to check if the 532 // 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 533 // user allows it first (in case the administrator didn't already decide
526 // via policy). 534 // via policy).
527 if (!controlled_by_policy) 535 if (!controlled_by_policy)
528 crash_reporting_enabled = GoogleUpdateSettings::GetCollectStatsConsent(); 536 crash_reporting_enabled = GoogleUpdateSettings::GetCollectStatsConsent();
529 537
530 if (!crash_reporting_enabled) { 538 if (!crash_reporting_enabled) {
531 // Configuration managed or the user did not allow Google Update to send 539 // 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 540 // crashes, we need to use our default crash handler instead, but only
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 if (QueueUserWorkItem( 629 if (QueueUserWorkItem(
622 &InitCrashReporterThread, 630 &InitCrashReporterThread,
623 info, 631 info,
624 WT_EXECUTELONGFUNCTION) == 0) { 632 WT_EXECUTELONGFUNCTION) == 0) {
625 // We failed to queue to the worker pool, initialize in this thread. 633 // We failed to queue to the worker pool, initialize in this thread.
626 InitCrashReporterThread(info); 634 InitCrashReporterThread(info);
627 } 635 }
628 } 636 }
629 } 637 }
630 } 638 }
OLDNEW
« no previous file with comments | « no previous file | chrome/tools/crash_service/crash_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698