For actions, switch bool success into an exit code.
This way we can signal specific error conditions and then
send appropriate events to Omaha from the UpdateAttempter.
BUG=560
TEST=unit tests, gmerged and looked at logs
Review URL: http://codereview.chromium.org/3022008
diff --git a/omaha_request_action.cc b/omaha_request_action.cc
index 6f9a790..e801f40 100644
--- a/omaha_request_action.cc
+++ b/omaha_request_action.cc
@@ -215,7 +215,7 @@
// Events are best effort transactions -- assume they always succeed.
if (IsEvent()) {
CHECK(!HasOutputPipe()) << "No output pipe allowed for event requests.";
- completer.set_success(true);
+ completer.set_code(kActionCodeSuccess);
return;
}
@@ -226,7 +226,7 @@
if (!HasOutputPipe()) {
// Just set success to whether or not the http transfer succeeded,
// which must be true at this point in the code.
- completer.set_success(true);
+ completer.set_code(kActionCodeSuccess);
return;
}
@@ -267,7 +267,7 @@
LOG(INFO) << "No update.";
output_object.update_exists = false;
SetOutputObject(output_object);
- completer.set_success(true);
+ completer.set_code(kActionCodeSuccess);
return;
}
@@ -279,7 +279,7 @@
// In best-effort fashion, fetch the rest of the expected attributes
// from the updatecheck node, then return the object
output_object.update_exists = true;
- completer.set_success(true);
+ completer.set_code(kActionCodeSuccess);
output_object.display_version =
XmlGetProperty(updatecheck_node, "DisplayVersion");