diff options
author | grt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-10 16:49:06 +0000 |
---|---|---|
committer | grt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-10 16:49:06 +0000 |
commit | 122f4c2d78fd24ae5720612c21e80f2fe145aae0 (patch) | |
tree | 27d231518cb39ed9d1a7add74bcda30064ef49d9 /chrome | |
parent | 1e63e31eb78e13f9bb95c9d81a43dee4babb1a56 (diff) | |
download | chromium_src-122f4c2d78fd24ae5720612c21e80f2fe145aae0.zip chromium_src-122f4c2d78fd24ae5720612c21e80f2fe145aae0.tar.gz chromium_src-122f4c2d78fd24ae5720612c21e80f2fe145aae0.tar.bz2 |
Send the user's Windows profile type up in crash reports.
I suspect that some of the version shear crashes happen to users with non-local profiles. In this case, it's easy to imagine that the version info in the registry is out of sync with that on the filesystem.
BUG=78585
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10740003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145892 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/breakpad_win.cc | 33 | ||||
-rw-r--r-- | chrome/chrome_exe.gypi | 3 |
2 files changed, 36 insertions, 0 deletions
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc index 7cee745..100cca5 100644 --- a/chrome/app/breakpad_win.cc +++ b/chrome/app/breakpad_win.cc @@ -7,6 +7,7 @@ #include <windows.h> #include <shellapi.h> #include <tchar.h> +#include <userenv.h> #include <algorithm> #include <vector> @@ -221,6 +222,35 @@ void SetPluginPath(const std::wstring& path) { } } +// Returns a string containing a list of all modifiers for the loaded profile. +std::wstring GetProfileType() { + std::wstring profile_type; + DWORD profile_bits = 0; + if (::GetProfileType(&profile_bits)) { + static const struct { + DWORD bit; + const wchar_t* name; + } kBitNames[] = { + { PT_MANDATORY, L"mandatory" }, + { PT_ROAMING, L"roaming" }, + { PT_TEMPORARY, L"temporary" }, + }; + for (size_t i = 0; i < arraysize(kBitNames); ++i) { + const DWORD this_bit = kBitNames[i].bit; + if ((profile_bits & this_bit) != 0) { + profile_type.append(kBitNames[i].name); + profile_bits &= ~this_bit; + if (profile_bits != 0) + profile_type.append(L", "); + } + } + } else { + DWORD last_error = ::GetLastError(); + base::SStringPrintf(&profile_type, L"error %u", last_error); + } + return profile_type; +} + // Returns the custom info structure based on the dll in parameter and the // process type. google_breakpad::CustomClientInfo* GetCustomInfo(const std::wstring& exe_path, @@ -266,6 +296,9 @@ google_breakpad::CustomClientInfo* GetCustomInfo(const std::wstring& exe_path, google_breakpad::CustomInfoEntry(L"ptype", type.c_str())); g_custom_entries->push_back( google_breakpad::CustomInfoEntry(L"channel", channel.c_str())); + g_custom_entries->push_back( + google_breakpad::CustomInfoEntry(L"profile-type", + GetProfileType().c_str())); if (!special_build.empty()) g_custom_entries->push_back( diff --git a/chrome/chrome_exe.gypi b/chrome/chrome_exe.gypi index 3da48fb..7a78ec5 100644 --- a/chrome/chrome_exe.gypi +++ b/chrome/chrome_exe.gypi @@ -464,6 +464,9 @@ ], 'msvs_settings': { 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'userenv.lib', + ], 'ImportLibrary': '$(OutDir)\\lib\\chrome_exe.lib', 'ProgramDatabaseFile': '$(OutDir)\\chrome_exe.pdb', 'DelayLoadDLLs': [ |