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.h b/update_manager/update_manager.h
index 8c96d7b..5d7a045 100644
--- a/update_manager/update_manager.h
+++ b/update_manager/update_manager.h
@@ -8,6 +8,7 @@
#include <base/callback.h>
#include <base/memory/ref_counted.h>
#include <base/memory/scoped_ptr.h>
+#include <base/time/time.h>
#include "update_engine/clock_interface.h"
#include "update_engine/update_manager/default_policy.h"
@@ -22,7 +23,7 @@
// Creates the UpdateManager instance, assuming ownership on the provided
// |state|.
UpdateManager(chromeos_update_engine::ClockInterface* clock,
- State* state);
+ base::TimeDelta evaluation_timeout, State* state);
virtual ~UpdateManager() {}
@@ -119,6 +120,9 @@
// Pointer to the mockable clock interface;
chromeos_update_engine::ClockInterface* clock_;
+ // Timeout for a policy evaluation.
+ const base::TimeDelta evaluation_timeout_;
+
DISALLOW_COPY_AND_ASSIGN(UpdateManager);
};