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

Unified Diff: action_processor.h

Issue 3022008: For actions, switch bool success into an exit code. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: switch to all positive error codes. Created 10 years, 5 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 | « no previous file | action_processor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: action_processor.h
diff --git a/action_processor.h b/action_processor.h
index 8311b8a633f4eade92f903448095f6f93ac3dbea..f04345df8fd948d0ba16f2f3a2af2875a5a1a8a0 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
« no previous file with comments | « no previous file | action_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698