update_engine: Parse and supply EOL date for Chrome

From Omaha, the optional field |_eol_date| is to indicate the EOL of a
device. Chrome side will leverage these values to display a
notification. The value for |_eol_date| should be an integer value
indicating the days from Unix Epoch date.

If |_eol_date| does not exist in the Omaha response or have non-integer
values, the default will fallback to |kEolDateInvalid|.

BUG=chromium:998983
TEST=FEATURES="test" emerge-$B update_engine update_engine-client system_api
TEST=test_that -b $B $IP autoupdate_EOL
TEST=test_that -b $B $IP autoupdate_EOL.approaching_eol
TEST=test_that -b $B $IP autoupdate_EOL.future_eol

Cq-Depend:chromium:1783596, chromium:1811116
Change-Id: I2b1063873118ccf8fe22ba09a5961e27aa980c7b
Reviewed-on: https://chromium-review.googlesource.com/1783897
Tested-by: Jae Hoon Kim <kimjae@chromium.org>
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/omaha_utils.h b/omaha_utils.h
index 8614540..128232a 100644
--- a/omaha_utils.h
+++ b/omaha_utils.h
@@ -21,6 +21,16 @@
 
 namespace chromeos_update_engine {
 
+using EolDate = int64_t;
+
+// |EolDate| indicating an invalid end-of-life date.
+extern const EolDate kEolDateInvalid;
+
+// The possible string values for the end-of-life status.
+extern const char kEolStatusSupported[];
+extern const char kEolStatusSecurityOnly[];
+extern const char kEolStatusEol[];
+
 // The end-of-life status of the device.
 enum class EolStatus {
   kSupported = 0,
@@ -35,6 +45,14 @@
 // of an invalid string, the default "supported" value will be used instead.
 EolStatus StringToEolStatus(const std::string& eol_status);
 
+// Returns the string representation of the |eol_date|.
+std::string EolDateToString(EolDate eol_date);
+
+// Converts the end-of-life date string to an EolDate numeric value. In case
+// of an invalid string, the default |kEolDateInvalid| value will be used
+// instead.
+EolDate StringToEolDate(const std::string& eol_date);
+
 }  // namespace chromeos_update_engine
 
 #endif  // UPDATE_ENGINE_OMAHA_UTILS_H_