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

Unified Diff: chrome_frame/ready_mode/internal/registry_ready_mode_state.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
« no previous file with comments | « chrome_frame/policy_settings.cc ('k') | chrome_frame/test/chrome_frame_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/ready_mode/internal/registry_ready_mode_state.cc
===================================================================
--- chrome_frame/ready_mode/internal/registry_ready_mode_state.cc (revision 71761)
+++ chrome_frame/ready_mode/internal/registry_ready_mode_state.cc (working copy)
@@ -34,9 +34,11 @@
for (int i = 0; i < arraysize(roots); i++) {
base::win::RegKey version_key;
- if (version_key.Open(roots[i], version_key_name.c_str(), KEY_QUERY_VALUE)) {
+ if (version_key.Open(roots[i], version_key_name.c_str(),
+ KEY_QUERY_VALUE) == ERROR_SUCCESS) {
std::wstring command_line;
- if (version_key.ReadValue(command_field.c_str(), &command_line)) {
+ if (version_key.ReadValue(command_field.c_str(),
+ &command_line) == ERROR_SUCCESS) {
HANDLE launched_process = NULL;
if (base::LaunchApp(command_line, false, true, &launched_process)) {
return launched_process;
@@ -186,34 +188,24 @@
*exists = false;
*value = 0;
- HKEY roots[] = {HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE};
-
+ HKEY roots[] = { HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE };
+ LONG result = ERROR_SUCCESS;
for (int i = 0; i < arraysize(roots); i++) {
base::win::RegKey config_key;
-
- if (config_key.Open(roots[i], key_name_.c_str(), KEY_QUERY_VALUE)) {
- if (config_key.ValueExists(installer::kChromeFrameReadyModeField)) {
- int64 temp;
- DWORD value_size = sizeof(temp);
- DWORD type = 0;
- if (!config_key.ReadValue(installer::kChromeFrameReadyModeField,
- &temp, &value_size, &type)) {
- DLOG(ERROR) << "Failed to read from registry key " << key_name_
- << " and value " << installer::kChromeFrameReadyModeField;
- return false;
- }
-
- if (value_size != sizeof(temp) || type != REG_QWORD) {
- DLOG(ERROR) << "Unexpected state found under registry key "
- << key_name_ << " and value "
- << installer::kChromeFrameReadyModeField;
- return false;
- }
-
- *value = temp;
+ result = config_key.Open(roots[i], key_name_.c_str(), KEY_QUERY_VALUE);
+ if (result == ERROR_SUCCESS) {
+ result = config_key.ReadInt64(installer::kChromeFrameReadyModeField,
+ value);
+ if (result == ERROR_SUCCESS) {
*exists = true;
return true;
}
+ if (result != ERROR_FILE_NOT_FOUND) {
+ DLOG(ERROR) << "Failed to read from registry key " << key_name_
+ << " and value " << installer::kChromeFrameReadyModeField
+ << " error: " << result;
+ return false;
+ }
}
}
« no previous file with comments | « chrome_frame/policy_settings.cc ('k') | chrome_frame/test/chrome_frame_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698