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/update_attempter.cc b/update_attempter.cc
index 7e536b4..b5d9644 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -198,11 +198,11 @@
// Delegate methods:
void UpdateAttempter::ProcessingDone(const ActionProcessor* processor,
- bool success) {
+ ActionExitCode code) {
CHECK(response_handler_action_);
LOG(INFO) << "Processing Done.";
actions_.clear();
- if (success) {
+ if (code == kActionCodeSuccess) {
SetStatusAndNotify(UPDATE_STATUS_UPDATED_NEED_REBOOT);
utils::WriteFile(kUpdateCompletedMarker, "", 0);
} else {
@@ -221,13 +221,13 @@
// or otherwise.
void UpdateAttempter::ActionCompleted(ActionProcessor* processor,
AbstractAction* action,
- bool success) {
+ ActionExitCode code) {
// Reset download progress regardless of whether or not the download action
// succeeded.
const string type = action->Type();
if (type == DownloadAction::StaticType())
download_progress_ = 0.0;
- if (!success)
+ if (code != kActionCodeSuccess)
return;
// Find out which action completed.
if (type == OmahaResponseHandlerAction::StaticType()) {