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

Unified Diff: utils.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 | « update_attempter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils.h
diff --git a/utils.h b/utils.h
index c6edb7d985e232883d2463131d5f636136aba870..5a3efe94414c1499a1ae7ea8c1ffc1a9c58f8049 100644
--- a/utils.h
+++ b/utils.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -134,7 +134,7 @@ std::set<ValueType> SetWithValue(const ValueType& value) {
template<typename T>
bool VectorContainsValue(const std::vector<T>& vect, const T& value) {
- return std::find(vect.begin(), vect.end(), value) != vect.end();
+ return std::find(vect.begin(), vect.end(), value) != vect.end();
}
template<typename T>
@@ -234,22 +234,21 @@ class ScopedActionCompleter {
AbstractAction* action)
: processor_(processor),
action_(action),
- success_(false),
+ code_(kActionCodeError),
should_complete_(true) {}
~ScopedActionCompleter() {
if (should_complete_)
- processor_->ActionComplete(action_, success_);
- }
- void set_success(bool success) {
- success_ = success;
+ processor_->ActionComplete(action_, code_);
}
+ void set_code(ActionExitCode code) { code_ = code; }
void set_should_complete(bool should_complete) {
should_complete_ = should_complete;
}
+
private:
ActionProcessor* processor_;
AbstractAction* action_;
- bool success_;
+ ActionExitCode code_;
bool should_complete_;
DISALLOW_COPY_AND_ASSIGN(ScopedActionCompleter);
};
« no previous file with comments | « update_attempter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698