UM: Policy for deciding download URL.

This adds a new private policy (UpdateDownloadUrl) for determining which
download URL should be used for obtaining the update payload. We further
extend an existing public policy (UpdateCanStart) to return the download
URL details, based on the current URL index and the number of failures
associated with it. This renders the explicit notion of "HTTP download
allowed" in the return value unnecessary: If HTTP is not allowed, then
HTTP URLs will not be considered.

We also implement logic for logging the start/end of a policy
evaluation, so that intermediate log messages emitted during evaluation
have a clear context.

BUG=chromium:358329
TEST=Unit tests.

Change-Id: Ib5343417480d8825082f83bed2630a6611360b61
Reviewed-on: https://chromium-review.googlesource.com/203373
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/update_manager_unittest.cc b/update_manager/update_manager_unittest.cc
index 95fd3e0..fa6f9dd 100644
--- a/update_manager/update_manager_unittest.cc
+++ b/update_manager/update_manager_unittest.cc
@@ -25,6 +25,7 @@
 using base::Callback;
 using base::Time;
 using base::TimeDelta;
+using chromeos_update_engine::ErrorCode;
 using chromeos_update_engine::FakeClock;
 using std::pair;
 using std::string;
@@ -106,7 +107,9 @@
 
 TEST_F(UmUpdateManagerTest, PolicyRequestCallUpdateCanStart) {
   const UpdateState update_state = {
-    FixedTime(), 1, TimeDelta::FromSeconds(15), TimeDelta::FromSeconds(60),
+    FixedTime(), 1,
+    vector<string>(1, "http://fake/url/"), 10, 0, 0, vector<ErrorCode>(),
+    TimeDelta::FromSeconds(15), TimeDelta::FromSeconds(60),
     4, 2, 8
   };
   UpdateCanStartResult result;