diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-09 19:59:25 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-09 19:59:25 +0000 |
commit | 3b781fed071f7681c6113dd0042388ceaf7f4d15 (patch) | |
tree | c450c72a09a9e8ae442cd0c3b9902df046077537 /chrome_frame/chrome_frame_reporting.cc | |
parent | 273865aa130f61f321d3eeafc0ea5a2a6dc9adf8 (diff) | |
download | chromium_src-3b781fed071f7681c6113dd0042388ceaf7f4d15.zip chromium_src-3b781fed071f7681c6113dd0042388ceaf7f4d15.tar.gz chromium_src-3b781fed071f7681c6113dd0042388ceaf7f4d15.tar.bz2 |
The ChromeFrame crash reporting code should not depend on chrome frame as it is also linked
in by toolbar.
This CL gets rid of this dependency and also ensures that full crash dumps are gathered during
chrome frame reliability test runs.
Review URL: http://codereview.chromium.org/481003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34180 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_frame_reporting.cc')
-rw-r--r-- | chrome_frame/chrome_frame_reporting.cc | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/chrome_frame/chrome_frame_reporting.cc b/chrome_frame/chrome_frame_reporting.cc index 688651e..202d43c 100644 --- a/chrome_frame/chrome_frame_reporting.cc +++ b/chrome_frame/chrome_frame_reporting.cc @@ -15,6 +15,7 @@ // Well known SID for the system principal. const wchar_t kSystemPrincipalSid[] = L"S-1-5-18"; +const wchar_t kChromePipeName[] = L"\\\\.\\pipe\\ChromeCrashServices"; // Returns the custom info structure based on the dll in parameter google_breakpad::CustomClientInfo* GetCustomInfo(const wchar_t* dll_path) { @@ -48,19 +49,30 @@ extern "C" IMAGE_DOS_HEADER __ImageBase; bool InitializeCrashReporting() { // In headless mode we want crashes to be reported back. - if (!IsHeadlessMode()) { - // We want to use the Google Update crash reporting. We need to check if the - // user allows it first. - if (!GoogleUpdateSettings::GetCollectStatsConsent()) + bool always_take_dump = IsHeadlessMode(); + // We want to use the Google Update crash reporting. We need to check if the + // user allows it first. + if (!always_take_dump && !GoogleUpdateSettings::GetCollectStatsConsent()) return true; + + // Get the alternate dump directory. We use the temp path. + FilePath temp_directory; + if (!file_util::GetTempDir(&temp_directory) || temp_directory.empty()) { + return false; } - // Build the pipe name. It can be either: - // System-wide install: "NamedPipe\GoogleCrashServices\S-1-5-18" - // Per-user install: "NamedPipe\GoogleCrashServices\<user SID>" + wchar_t dll_path[MAX_PATH * 2] = {0}; GetModuleFileName(reinterpret_cast<HMODULE>(&__ImageBase), dll_path, arraysize(dll_path)); + if (always_take_dump) { + return InitializeVectoredCrashReportingWithPipeName(true, kChromePipeName, + temp_directory.value(), GetCustomInfo(dll_path)); + } + + // Build the pipe name. It can be either: + // System-wide install: "NamedPipe\GoogleCrashServices\S-1-5-18" + // Per-user install: "NamedPipe\GoogleCrashServices\<user SID>" std::wstring user_sid; if (InstallUtil::IsPerUserInstall(dll_path)) { if (!win_util::GetUserSidString(&user_sid)) { @@ -70,12 +82,6 @@ bool InitializeCrashReporting() { user_sid = kSystemPrincipalSid; } - // Get the alternate dump directory. We use the temp path. - FilePath temp_directory; - if (!file_util::GetTempDir(&temp_directory) || temp_directory.empty()) { - return false; - } - return InitializeVectoredCrashReporting(false, user_sid.c_str(), temp_directory.value(), GetCustomInfo(dll_path)); } |