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_manager-inl.h b/policy_manager/policy_manager-inl.h
index e4b9666..798860f 100644
--- a/policy_manager/policy_manager-inl.h
+++ b/policy_manager/policy_manager-inl.h
@@ -20,13 +20,13 @@
EvalStatus status = (policy_.get()->*policy_method)(&ec, state_.get(), &error,
result, args...);
- if (status == EvalStatusFailed) {
+ if (status == EvalStatus::kFailed) {
LOG(WARNING) << "PolicyRequest() failed with error: " << error;
error.clear();
status = (default_policy_.*policy_method)(&ec, state_.get(), &error,
result, args...);
- if (status == EvalStatusFailed) {
+ if (status == EvalStatus::kFailed) {
LOG(WARNING) << "Request to DefaultPolicy also failed, passing error.";
}
}