diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 18:23:32 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 18:23:32 +0000 |
commit | 708555800b168c3fc694f5f391d8128e0f0dca48 (patch) | |
tree | b19460b0172dc16319b3b5502167cff3073bf2df /chrome/app | |
parent | 01d0801106ea6e2c62c988ffd0aac6aa59e945ff (diff) | |
download | chromium_src-708555800b168c3fc694f5f391d8128e0f0dca48.zip chromium_src-708555800b168c3fc694f5f391d8128e0f0dca48.tar.gz chromium_src-708555800b168c3fc694f5f391d8128e0f0dca48.tar.bz2 |
Initialize default crash callback if we fail to get user SID.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/261029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28848 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app')
-rw-r--r-- | chrome/app/breakpad_win.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc index 05e60fd..11f06b6 100644 --- a/chrome/app/breakpad_win.cc +++ b/chrome/app/breakpad_win.cc @@ -266,19 +266,17 @@ static DWORD __stdcall InitCrashReporterThread(void* param) { // we do it here so it can run in a separate thread. info->custom_info = GetCustomInfo(info->dll_path, info->process_type); - const CommandLine& command = *CommandLine::ForCurrentProcess(); - bool full_dump = command.HasSwitch(switches::kFullMemoryCrashReport); - bool use_crash_service = command.HasSwitch(switches::kNoErrorDialogs) || - GetEnvironmentVariable(L"CHROME_HEADLESS", NULL, 0); - google_breakpad::ExceptionHandler::MinidumpCallback callback = NULL; - if (info->process_type == L"browser") { // We install the post-dump callback only for the browser process. It // spawns a new browser process. callback = &DumpDoneCallback; } + const CommandLine& command = *CommandLine::ForCurrentProcess(); + bool use_crash_service = command.HasSwitch(switches::kNoErrorDialogs) || + GetEnvironmentVariable(L"CHROME_HEADLESS", NULL, 0); + std::wstring pipe_name; if (use_crash_service) { // Crash reporting is done by crash_service.exe. @@ -299,8 +297,11 @@ static DWORD __stdcall InitCrashReporterThread(void* param) { // Per-user install: "NamedPipe\GoogleCrashServices\<user SID>" std::wstring user_sid; if (InstallUtil::IsPerUserInstall(info->dll_path.c_str())) { - if (!win_util::GetUserSidString(&user_sid)) + if (!win_util::GetUserSidString(&user_sid)) { + if (callback) + InitDefaultCrashCallback(); return -1; + } } else { user_sid = kSystemPrincipalSid; } @@ -313,6 +314,7 @@ static DWORD __stdcall InitCrashReporterThread(void* param) { wchar_t temp_dir[MAX_PATH] = {0}; ::GetTempPathW(MAX_PATH, temp_dir); + bool full_dump = command.HasSwitch(switches::kFullMemoryCrashReport); MINIDUMP_TYPE dump_type = full_dump ? MiniDumpWithFullMemory : MiniDumpNormal; g_breakpad = new google_breakpad::ExceptionHandler(temp_dir, NULL, callback, |