summaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorGilad Arnold <garnold@chromium.org>2014-06-05 14:07:53 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-06-13 05:34:28 +0000
commitd1c4d2dd3daed1d507038046c0355fbafb85260c (patch)
treec25e3f382d17439215294aacfaa7b18e5b8e2d9b /utils.h
parent0a364bb65efa5c5cdcd49114080a646a39e030fc (diff)
Change ErrorCode into an enum class.
This change is needed in order for us to be able to import ErrorCode symbols from chromeos_update_engine into chromeos_update_manager. Unfortunately, shifting from plain 'enum' into an 'enum class' means that the compiler treats the new class as a distinct type from int, which in turn means that plenty of seamless arithmetic/bitwise operations we used for manipulating error code values throughout the code needed to be retrofitted with static_cast operators. In the future, we should consider imposing a proper abstraction on update engine error codes that'll prevent mingling with value encoding directly and prevent such nastiness. It'll also make things more coherent (types, semantics) and safer. BUG=chromium:358329 TEST=Unit tests. Change-Id: Ie55fa566b764cdab6c4785d995fb6daee4cb32d3 Reviewed-on: https://chromium-review.googlesource.com/203209 Tested-by: Gilad Arnold <garnold@chromium.org> Reviewed-by: Alex Deymo <deymo@chromium.org> Commit-Queue: Gilad Arnold <garnold@chromium.org>
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils.h b/utils.h
index d2a0fc21..ed71e9f2 100644
--- a/utils.h
+++ b/utils.h
@@ -347,7 +347,7 @@ ErrorCode GetBaseErrorCode(ErrorCode code);
// Transforms a ErrorCode value into a metrics::DownloadErrorCode.
// This obviously only works for errors related to downloading so if |code|
-// is e.g. |kErrorCodeFilesystemCopierError| then
+// is e.g. |ErrorCode::kFilesystemCopierError| then
// |kDownloadErrorCodeInputMalformed| is returned.
metrics::DownloadErrorCode GetDownloadErrorCode(ErrorCode code);
@@ -570,7 +570,7 @@ class ScopedActionCompleter {
AbstractAction* action)
: processor_(processor),
action_(action),
- code_(kErrorCodeError),
+ code_(ErrorCode::kError),
should_complete_(true) {}
~ScopedActionCompleter() {
if (should_complete_)