update_engine: UM: Change policy argument from const ref to value.
It turns out that passing an argument by reference to UpdateCanStart via
UpdateManager::AsyncPolicyRequest is a pain. Furthermore, given that the
policy is async by definition, it makes little sense to hand it a const
reference argument. This changes the said argument to be passed by
value.
BUG=chromium:396148
TEST=Unit tests.
Change-Id: I45a8141b389c173347f3a6b7dc03ffe46cb32228
Reviewed-on: https://chromium-review.googlesource.com/219694
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
diff --git a/update_manager/chromeos_policy.cc b/update_manager/chromeos_policy.cc
index 9afc00d..a3d6495 100644
--- a/update_manager/chromeos_policy.cc
+++ b/update_manager/chromeos_policy.cc
@@ -267,7 +267,7 @@
State* state,
string* error,
UpdateDownloadParams* result,
- const UpdateState& update_state) const {
+ const UpdateState update_state) const {
// Set the default return values. Note that we set persisted values (backoff,
// scattering) to the same values presented in the update state. The reason is
// that preemptive returns, such as the case where an update check is due,