summaryrefslogtreecommitdiffstats
path: root/chrome/app/breakpad_win.cc
diff options
context:
space:
mode:
authoramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-19 07:28:46 +0000
committeramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-19 07:28:46 +0000
commite06f4d5c6bd7bad162c45784e39cd0114635eb42 (patch)
treee53d6b4188af6e49393babc92a797ed5734a1026 /chrome/app/breakpad_win.cc
parent2b107a348f2b27934fe38680ec8010d743f61765 (diff)
downloadchromium_src-e06f4d5c6bd7bad162c45784e39cd0114635eb42.zip
chromium_src-e06f4d5c6bd7bad162c45784e39cd0114635eb42.tar.gz
chromium_src-e06f4d5c6bd7bad162c45784e39cd0114635eb42.tar.bz2
Regkey functions return error code instead of bool
Change the Regkey helper to consistently use and return LONG instead of bool. Fix RegKey usage all over the code base and get rid of workarounds due to lack of return value. Reviewers: brettw: everything (skip parts for other reviewers if you wish) robertshield,grt: chrome_frame, installer siggi: ceee BUG=none TEST=covered by existing tests Review URL: http://codereview.chromium.org/6090006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71768 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/breakpad_win.cc')
-rw-r--r--chrome/app/breakpad_win.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc
index 9f04967..9fe1032 100644
--- a/chrome/app/breakpad_win.cc
+++ b/chrome/app/breakpad_win.cc
@@ -437,17 +437,18 @@ bool ShowRestartDialogIfCrashed(bool* exit_now) {
// contains the value set by policy.
static bool MetricsReportingControlledByPolicy(bool* result) {
std::wstring key_name = UTF8ToWide(policy::key::kMetricsReportingEnabled);
- DWORD value;
+ DWORD value = 0;
+ // TODO(joshia): why hkcu_policy_key opens HKEY_LOCAL_MACHINE?
base::win::RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE,
policy::kRegistrySubKey, KEY_READ);
- if (hkcu_policy_key.ReadValueDW(key_name.c_str(), &value)) {
+ if (hkcu_policy_key.ReadValueDW(key_name.c_str(), &value) == ERROR_SUCCESS) {
*result = value != 0;
return true;
}
base::win::RegKey hklm_policy_key(HKEY_CURRENT_USER,
policy::kRegistrySubKey, KEY_READ);
- if (hklm_policy_key.ReadValueDW(key_name.c_str(), &value)) {
+ if (hklm_policy_key.ReadValueDW(key_name.c_str(), &value) == ERROR_SUCCESS) {
*result = value != 0;
return true;
}