Commit 246ac920 authored by grt@chromium.org's avatar grt@chromium.org

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.

Copied from http://codereview.chromium.org/10740003/.  Try jobs on the first pass missed a compile break in chrome_nacl_win64.

BUG=78585
TEST=none
TBR=siggi@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10698129

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145908 0039d316-1c4b-4281-b951-d872f2087c98
parent f3a2eba3
......@@ -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(
......
......@@ -464,6 +464,9 @@
],
'msvs_settings': {
'VCLinkerTool': {
'AdditionalDependencies': [
'userenv.lib',
],
'ImportLibrary': '$(OutDir)\\lib\\chrome_exe.lib',
'ProgramDatabaseFile': '$(OutDir)\\chrome_exe.pdb',
'DelayLoadDLLs': [
......@@ -562,6 +565,9 @@
],
'msvs_settings': {
'VCLinkerTool': {
'AdditionalDependencies': [
'userenv.lib',
],
'ImportLibrary': '$(OutDir)\\lib\\nacl64_exe.lib',
'ProgramDatabaseFile': '$(OutDir)\\nacl64_exe.pdb',
'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment