Add metrics to report the number of bytes downloaded per protocol.

This CL adds these two basic metrics:
1. The number of megabytes downloaded using each protocol (or source
in general, as we want to consider HTTP downloads from server and possibly
a peer in future as two different sources) for each successful update. The
totals across all protocols will equal the payload size exactly.
2. The total number of megabytes downloaded since the last update attempt.
If there are no errors, this should be same as above. Otherwise, this will
be larger and will help us to compute the update efficiency.

BUG=chromium:225953
TEST=Unit tests pass, new Unit tests added.
TEST=chrome://histograms shows metrics correctly.

Change-Id: Ic02e218f46568427df99a8a9df2011860aee84f3
Reviewed-on: https://gerrit.chromium.org/gerrit/48069
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
diff --git a/utils.h b/utils.h
index 46b06e1..53e58fe 100644
--- a/utils.h
+++ b/utils.h
@@ -19,6 +19,7 @@
 #include "metrics/metrics_library.h"
 
 #include "update_engine/action.h"
+#include "update_engine/constants.h"
 #include "update_engine/action_processor.h"
 
 namespace chromeos_update_engine {
@@ -158,6 +159,9 @@
 // Returns true or false depending on the value of b.
 std::string ToString(bool b);
 
+// Returns a string representation of the given enum.
+std::string ToString(DownloadSource source);
+
 enum BootLoader {
   BootLoader_SYSLINUX = 0,
   BootLoader_CHROME_FIRMWARE = 1