Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3432)

Unified Diff: chrome/app/breakpad_win.cc

Issue 10698129: Send the user's Windows profile type up in crash reports. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix chrome_nacl_win64. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/chrome_exe.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/breakpad_win.cc
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc
index 7cee74508b4cd286e005de65031c5ee514b0893a..100cca513b8768da2ba89384331f2c12bc15b363 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(
« no previous file with comments | « no previous file | chrome/chrome_exe.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698