UM: Make the evaluation timeout configurable.
This allows the client to construct the UpdateManager with a custom
evaluation timeout for sync policy requests, which is in turn being
passed to each EvaluationContext instance used for sync policy
evaluation.
BUG=chromium:363790
TEST=Unit tests.
Change-Id: I5a6ec02a3ca2a2c611276eacbcda6aac8304e929
Reviewed-on: https://chromium-review.googlesource.com/204687
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
diff --git a/update_manager/update_manager-inl.h b/update_manager/update_manager-inl.h
index 362d4c5..44b0d25 100644
--- a/update_manager/update_manager-inl.h
+++ b/update_manager/update_manager-inl.h
@@ -84,7 +84,8 @@
std::string*, R*,
ExpectedArgs...) const,
R* result, ActualArgs... args) {
- scoped_refptr<EvaluationContext> ec(new EvaluationContext(clock_));
+ scoped_refptr<EvaluationContext> ec(
+ new EvaluationContext(clock_, evaluation_timeout_));
// A PolicyRequest allways consists on a single evaluation on a new
// EvaluationContext.
// IMPORTANT: To ensure that ActualArgs can be converted to ExpectedArgs, we
@@ -106,7 +107,8 @@
std::string*, R*,
ExpectedArgs...) const,
ActualArgs... args) {
- scoped_refptr<EvaluationContext> ec = new EvaluationContext(clock_);
+ scoped_refptr<EvaluationContext> ec =
+ new EvaluationContext(clock_, evaluation_timeout_);
// IMPORTANT: To ensure that ActualArgs can be converted to ExpectedArgs, we
// explicitly instantiate UpdateManager::OnPolicyReadyToEvaluate with the
// latter in lieu of the former.