metrics library: move event file location from /var/log to /var/run

The event file, which is used for communicating metric events
from chrome os to chrome, has been living in the very non-kosher
location /var/log/metrics/uma-events.  This change duplicates it
in /var/run/metrics/uma-events.  A later chrome change will pick
up the metrics from there.

I also opened crbug.com/373833 to remove the duplication once
Chrome has switched over.

BUG=chromium:361331
TEST=tested with unit tests and manually

Change-Id: I98b741798aa0481b7987f93f087239ad214b759f
Reviewed-on: https://chromium-review.googlesource.com/200091
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
diff --git a/metrics/metrics_library.h b/metrics/metrics_library.h
index 74f5de2..a3f43c5 100644
--- a/metrics/metrics_library.h
+++ b/metrics/metrics_library.h
@@ -131,8 +131,12 @@
                        char* buffer, int buffer_size,
                        bool* result);
 
-  // Sends message of size |length| to Chrome for transport to UMA and
-  // returns true on success.
+  // TEMPORARY (see crbug.com/373833).  Stores a message to Chrome in the
+  // events file.
+  bool StoreMessageInFile(const std::string& message,
+                          const std::string& events_file);
+
+  // Sends message to Chrome for transport to UMA and returns true on success.
   bool SendMessageToChrome(const std::string& message);
 
   // Serializes a name/value pair into a message buffer.
@@ -154,6 +158,7 @@
   static bool cached_enabled_;
 
   std::string uma_events_file_;
+  std::string new_uma_events_file_;  // TEMPORARY see crbug.com/373833.
   std::string consent_file_;
 
   scoped_ptr<policy::PolicyProvider> policy_provider_;