Add sparse histograms to the metrics library and metrics client.

Samples to these histograms are any 32-bit int value.

BUG=chromium:222189
TEST=manual

Change-Id: Ic8d5773d05d717a275c4a4b5616e0e4c307337b8
Reviewed-on: https://gerrit.chromium.org/gerrit/45897
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
diff --git a/metrics/metrics_library.h b/metrics/metrics_library.h
index ce6985f..9a4c59b 100644
--- a/metrics/metrics_library.h
+++ b/metrics/metrics_library.h
@@ -20,6 +20,7 @@
   virtual bool SendToUMA(const std::string& name, int sample,
                          int min, int max, int nbuckets) = 0;
   virtual bool SendEnumToUMA(const std::string& name, int sample, int max) = 0;
+  virtual bool SendSparseToUMA(const std::string& name, int sample) = 0;
   virtual bool SendUserActionToUMA(const std::string& action) = 0;
   virtual ~MetricsLibraryInterface() {}
 };
@@ -74,6 +75,12 @@
   // normal, while 100 is high).
   bool SendEnumToUMA(const std::string& name, int sample, int max);
 
+  // Sends sparse histogram sample to Chrome for transport to UMA.  Returns
+  // true on success.
+  //
+  // |sample| is the 32-bit integer value to be recorded.
+  bool SendSparseToUMA(const std::string& name, int sample);
+
   // Sends a user action to Chrome for transport to UMA and returns true on
   // success. This method results in the equivalent of an asynchronous
   // non-blocking RPC to UserMetrics::RecordAction.  The new metric must be