PolicyManager: Schedule re-evaluations based on variable usage.
This patch makes the EvaluationContext re-schedule a policy request
based on the variables used by that method, waiting for the Async
variables and polling the Poll variables on the suggested interval.
In order to use the main loop functions from the EvaluationContext
they were moved to its own file called event_loop.h.
BUG=chromium:340871
TEST=Unit tests added.
Change-Id: Ibfc52e4dfd12c5e1ef87b5ad9cc318f9821dcfdd
Reviewed-on: https://chromium-review.googlesource.com/190424
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/SConstruct b/SConstruct
index b9a683c..aa7eb73 100644
--- a/SConstruct
+++ b/SConstruct
@@ -240,6 +240,7 @@
payload_state.cc
policy_manager/chromeos_policy.cc
policy_manager/evaluation_context.cc
+ policy_manager/event_loop.cc
policy_manager/policy_manager.cc
policy_manager/real_random_provider.cc
policy_manager/real_shill_provider.cc
@@ -296,6 +297,7 @@
payload_state_unittest.cc
policy_manager/boxed_value_unittest.cc
policy_manager/evaluation_context_unittest.cc
+ policy_manager/event_loop_unittest.cc
policy_manager/fake_state.cc
policy_manager/generic_variables_unittest.cc
policy_manager/policy_manager_unittest.cc