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

Unified Diff: chrome_frame/crash_reporting/crash_metrics.cc

Issue 6090006: Regkey functions return error code instead of bool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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
Index: chrome_frame/crash_reporting/crash_metrics.cc
===================================================================
--- chrome_frame/crash_reporting/crash_metrics.cc (revision 71561)
+++ chrome_frame/crash_reporting/crash_metrics.cc (working copy)
@@ -30,16 +30,19 @@
DCHECK(metric >= NAVIGATION_COUNT && metric <= LAST_METRIC);
base::win::RegKey metric_key;
- if (metric_key.Create(HKEY_CURRENT_USER, kChromeFrameMetricsKey,
- KEY_SET_VALUE)) {
- if (metric_key.WriteValue(g_metric_names[metric], value)) {
+ LONG result = metric_key.Create(HKEY_CURRENT_USER, kChromeFrameMetricsKey,
+ KEY_SET_VALUE);
+ if (result == ERROR_SUCCESS) {
+ result = metric_key.WriteValue(g_metric_names[metric], value);
+ if (result == ERROR_SUCCESS) {
return true;
} else {
DLOG(ERROR) << "Failed to read ChromeFrame metric:"
- << g_metric_names[metric];
+ << g_metric_names[metric] << " error: " << result;
}
} else {
- DLOG(ERROR) << "Failed to create ChromeFrame metrics key";
+ DLOG(ERROR) << "Failed to create ChromeFrame metrics key. error: "
+ << result;
}
return false;
}
@@ -50,13 +53,11 @@
int ret = 0;
base::win::RegKey metric_key;
if (metric_key.Open(HKEY_CURRENT_USER, kChromeFrameMetricsKey,
- KEY_QUERY_VALUE)) {
- int value = 0;
- if (metric_key.ReadValueDW(g_metric_names[metric],
- reinterpret_cast<DWORD*>(&value))) {
- ret = value;
- }
+ KEY_QUERY_VALUE) == ERROR_SUCCESS) {
+ metric_key.ReadValueDW(g_metric_names[metric],
+ reinterpret_cast<DWORD*>(&ret));
}
+
return ret;
}

Powered by Google App Engine
This is Rietveld 408576698