PolicyManager: Convert EvalStatus to a enum class.
This simple patch converts EvalStatus to a enum class to have better
type checking over the enum and group the constants on a namespace.
BUG=chromium:340871
TEST=Build and run unit tests.
Change-Id: I56e8d52325c5de578a6c78c7c85c9dccf61d48a1
Reviewed-on: https://chromium-review.googlesource.com/189635
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/policy_manager/policy.h b/policy_manager/policy.h
index 7554824..762b9a5 100644
--- a/policy_manager/policy.h
+++ b/policy_manager/policy.h
@@ -11,10 +11,10 @@
namespace chromeos_policy_manager {
// The three different results of a policy request.
-enum EvalStatus {
- EvalStatusFailed,
- EvalStatusSucceeded,
- EvalStatusAskMeAgainLater,
+enum class EvalStatus {
+ kFailed,
+ kSucceeded,
+ kAskMeAgainLater,
};
// The Policy class is an interface to the ensemble of policy requests that the
@@ -31,8 +31,8 @@
// first argument, a State instance, a returned error message, a returned
// value and optionally followed by one or more arbitrary constant arguments.
//
- // When the implementation fails, the method returns EvalStatusFailed and sets
- // the |error| string.
+ // When the implementation fails, the method returns EvalStatus::kFailed and
+ // sets the |error| string.
// UpdateCheckAllowed returns whether it is allowed to request an update check
// to Omaha.