PolicyManager: Include the Polling interval for kVariableModePoll variables.
A kVariableModePoll variable requires to be polled to know the if the
value changed. This patch adds a new GetPollInterval method that
tells how often a kVariableModePoll variable should be polled. This
value will be used by the policy manager to trigger re-evaluations
of the same policy request.
BUG=chromium:341209
TEST=unit tests added and passes.
Change-Id: I9c982ec8106ce39a0bc0889df7686add131b3bea
Reviewed-on: https://chromium-review.googlesource.com/187703
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/policy_manager/generic_variables.h b/policy_manager/generic_variables.h
index 7f76981..48764f1 100644
--- a/policy_manager/generic_variables.h
+++ b/policy_manager/generic_variables.h
@@ -39,6 +39,9 @@
// GetValue() method is called.
CopyVariable(const std::string& name, VariableMode mode, const T& ref)
: Variable<T>(name, mode), ref_(ref) {}
+ CopyVariable(const std::string& name, const base::TimeDelta& poll_interval,
+ const T& ref)
+ : Variable<T>(name, poll_interval), ref_(ref) {}
protected:
friend class PmCopyVariableTest;