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

Unified Diff: chrome/app/breakpad_win.cc

Issue 10740003: Send the user's Windows profile type up in crash reports. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: include error info 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..d37283c802e3889683e572ba7e87d4187109ff5b 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>
@@ -17,6 +18,7 @@
#include "base/file_util.h"
#include "base/file_version_info.h"
#include "base/memory/scoped_ptr.h"
+#include "base/string_number_conversions.h"
#include "base/string_split.h"
#include "base/string_util.h"
#include "base/string16.h"
@@ -221,6 +223,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 {
+ profile_type.assign(L"error ");
Sigurður Ásgeirsson 2012/07/10 10:11:14 ubernit: I'd grab GLE to a temp at the very top of
grt (UTC plus 2) 2012/07/10 12:13:48 top of the file? do you mean the top of this bloc
+ profile_type.append(base::UintToString16(::GetLastError()));
+ }
+ 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 +297,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