PolicyManager: Add a variable to tell when the Updater was started.

This patch adds a new const variable stating when was the updater
started in wallclock time. This value is required to schedule an
update check shortly after the update_engine starts, but use a
higher interval after the first update check.

BUG=chromium:358269
TEST=Added unittest.

Change-Id: Ife04c280207b5ccbf3a4a7828593cf01d1551a00
Reviewed-on: https://chromium-review.googlesource.com/197200
Reviewed-by: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/policy_manager/real_updater_provider.h b/policy_manager/real_updater_provider.h
index e4b308e..619d5ab 100644
--- a/policy_manager/real_updater_provider.h
+++ b/policy_manager/real_updater_provider.h
@@ -7,6 +7,7 @@
 
 #include <base/memory/scoped_ptr.h>
 
+#include "update_engine/policy_manager/generic_variables.h"
 #include "update_engine/policy_manager/updater_provider.h"
 #include "update_engine/system_state.h"
 
@@ -26,6 +27,10 @@
   // Initializes the provider and returns whether it succeeded.
   bool Init() { return true; }
 
+  virtual Variable<base::Time>* var_updater_started_time() override {
+    return &var_updater_started_time_;
+  }
+
   virtual Variable<base::Time>* var_last_checked_time() override {
     return var_last_checked_time_.get();
   }
@@ -70,7 +75,8 @@
   // A pointer to the update engine's system state aggregator.
   chromeos_update_engine::SystemState* system_state_;
 
-  // Pointers to all variable implementations.
+  // Variable implementations.
+  ConstCopyVariable<base::Time> var_updater_started_time_;
   scoped_ptr<Variable<base::Time>> var_last_checked_time_;
   scoped_ptr<Variable<base::Time>> var_update_completed_time_;
   scoped_ptr<Variable<double>> var_progress_;