| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 |
| 11 #include <algorithm> | 11 #include <algorithm> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/base_switches.h" | 14 #include "base/base_switches.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/file_util.h" | 16 #include "base/file_util.h" |
| 17 #include "base/file_version_info.h" | 17 #include "base/file_version_info.h" |
| 18 #include "base/registry.h" | 18 #include "base/registry.h" |
| 19 #include "base/string_util.h" | 19 #include "base/string_util.h" |
| 20 #include "base/win_util.h" | 20 #include "base/win_util.h" |
| 21 #include "breakpad/src/client/windows/handler/exception_handler.h" | 21 #include "breakpad/src/client/windows/handler/exception_handler.h" |
| 22 #include "chrome/app/hard_error_handler_win.h" | 22 #include "chrome/app/hard_error_handler_win.h" |
| 23 #include "chrome/common/child_process_logging.h" | 23 #include "chrome/common/child_process_logging.h" |
| 24 #include "chrome/common/env_vars.h" | 24 #include "chrome/common/env_vars.h" |
| 25 #include "chrome/common/result_codes.h" | 25 #include "chrome/common/result_codes.h" |
| 26 #include "chrome/installer/util/google_chrome_sxs_distribution.h" |
| 26 #include "chrome/installer/util/google_update_settings.h" | 27 #include "chrome/installer/util/google_update_settings.h" |
| 27 #include "chrome/installer/util/install_util.h" | 28 #include "chrome/installer/util/install_util.h" |
| 28 | 29 |
| 29 namespace { | 30 namespace { |
| 30 | 31 |
| 31 // Minidump with stacks, PEB, TEB, and unloaded module list. | 32 // Minidump with stacks, PEB, TEB, and unloaded module list. |
| 32 const MINIDUMP_TYPE kSmallDumpType = static_cast<MINIDUMP_TYPE>( | 33 const MINIDUMP_TYPE kSmallDumpType = static_cast<MINIDUMP_TYPE>( |
| 33 MiniDumpWithProcessThreadData | // Get PEB and TEB. | 34 MiniDumpWithProcessThreadData | // Get PEB and TEB. |
| 34 MiniDumpWithUnloadedModules); // Get unloaded modules when available. | 35 MiniDumpWithUnloadedModules); // Get unloaded modules when available. |
| 35 | 36 |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 | 399 |
| 399 MINIDUMP_TYPE dump_type = kSmallDumpType; | 400 MINIDUMP_TYPE dump_type = kSmallDumpType; |
| 400 // Capture full memory if explicitly instructed to. | 401 // Capture full memory if explicitly instructed to. |
| 401 if (command.HasSwitch(switches::kFullMemoryCrashReport)) { | 402 if (command.HasSwitch(switches::kFullMemoryCrashReport)) { |
| 402 dump_type = kFullDumpType; | 403 dump_type = kFullDumpType; |
| 403 } else { | 404 } else { |
| 404 // Capture more detail in crash dumps for beta and dev channel builds. | 405 // Capture more detail in crash dumps for beta and dev channel builds. |
| 405 string16 channel_string; | 406 string16 channel_string; |
| 406 GoogleUpdateSettings::GetChromeChannel(!is_per_user_install, | 407 GoogleUpdateSettings::GetChromeChannel(!is_per_user_install, |
| 407 &channel_string); | 408 &channel_string); |
| 408 if (channel_string == L"dev" || channel_string == L"beta") | 409 if (channel_string == L"dev" || channel_string == L"beta" || |
| 410 channel_string == GoogleChromeSxSDistribution::ChannelName()) |
| 409 dump_type = kLargerDumpType; | 411 dump_type = kLargerDumpType; |
| 410 } | 412 } |
| 411 | 413 |
| 412 g_breakpad = new google_breakpad::ExceptionHandler(temp_dir, &FilterCallback, | 414 g_breakpad = new google_breakpad::ExceptionHandler(temp_dir, &FilterCallback, |
| 413 callback, NULL, | 415 callback, NULL, |
| 414 google_breakpad::ExceptionHandler::HANDLER_ALL, | 416 google_breakpad::ExceptionHandler::HANDLER_ALL, |
| 415 dump_type, pipe_name.c_str(), info->custom_info); | 417 dump_type, pipe_name.c_str(), info->custom_info); |
| 416 | 418 |
| 417 if (!g_breakpad->IsOutOfProcess()) { | 419 if (!g_breakpad->IsOutOfProcess()) { |
| 418 // The out-of-process handler is unavailable. | 420 // The out-of-process handler is unavailable. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 if (QueueUserWorkItem( | 460 if (QueueUserWorkItem( |
| 459 &InitCrashReporterThread, | 461 &InitCrashReporterThread, |
| 460 info.release(), | 462 info.release(), |
| 461 WT_EXECUTELONGFUNCTION) == 0) { | 463 WT_EXECUTELONGFUNCTION) == 0) { |
| 462 // We failed to queue to the worker pool, initialize in this thread. | 464 // We failed to queue to the worker pool, initialize in this thread. |
| 463 InitCrashReporterThread(info.release()); | 465 InitCrashReporterThread(info.release()); |
| 464 } | 466 } |
| 465 } | 467 } |
| 466 } | 468 } |
| 467 } | 469 } |
| OLD | NEW |