summaryrefslogtreecommitdiff
path: root/action_processor.h
diff options
context:
space:
mode:
authorDarin Petkov <petkov@chromium.org>2010-07-19 11:34:49 -0700
committerDarin Petkov <petkov@chromium.org>2010-07-19 11:34:49 -0700
commitc1a8b426be9542bc880923711ca508ea3f84000e (patch)
tree3e4ce19a90f8eb5caf7aaf7c44f3d89255e27e23 /action_processor.h
parentcb319330c529b0394f6efb416dbe7b03bf38b19b (diff)
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
Diffstat (limited to 'action_processor.h')
-rw-r--r--action_processor.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/action_processor.h b/action_processor.h
index 8311b8a6..f04345df 100644
--- a/action_processor.h
+++ b/action_processor.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -21,6 +21,12 @@
namespace chromeos_update_engine {
+// Action exit codes.
+enum ActionExitCode {
+ kActionCodeSuccess = 0,
+ kActionCodeError = 1,
+};
+
class AbstractAction;
class ActionProcessorDelegate;
@@ -57,7 +63,7 @@ class ActionProcessor {
}
// Called by an action to notify processor that it's done. Caller passes self.
- void ActionComplete(AbstractAction* actionptr, bool success);
+ void ActionComplete(AbstractAction* actionptr, ActionExitCode code);
private:
// Actions that have not yet begun processing, in the order in which
@@ -78,9 +84,10 @@ class ActionProcessor {
class ActionProcessorDelegate {
public:
// Called when all processing in an ActionProcessor has completed. A pointer
- // to the ActionProcessor is passed. success is true iff all actions
- // completed successfully
- virtual void ProcessingDone(const ActionProcessor* processor, bool success) {}
+ // to the ActionProcessor is passed. |code| is set to the exit code of the
+ // last completed action.
+ virtual void ProcessingDone(const ActionProcessor* processor,
+ ActionExitCode code) {}
// Called when processing has stopped. Does not mean that all Actions have
// completed. If/when all Actions complete, ProcessingDone() will be called.
@@ -90,7 +97,7 @@ class ActionProcessorDelegate {
// or otherwise.
virtual void ActionCompleted(ActionProcessor* processor,
AbstractAction* action,
- bool success) {}
+ ActionExitCode code) {}
};
} // namespace chromeos_update_engine