Use lock-free lazy initialization for static histogram references

Make all histogram macros thread safe, and fast by again
using statics to achieve performance.

...at the cost of:
Leak all histograms to avoid races at shutdown.

Also included leak suppression for valgrind.

r=rtenneti
BUG=78207
Review URL: http://codereview.chromium.org/6780035

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80412 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/jankometer.cc b/chrome/browser/jankometer.cc
index 294860ce..14be3be 100644
--- a/chrome/browser/jankometer.cc
+++ b/chrome/browser/jankometer.cc
@@ -119,8 +119,8 @@
   // Counters for the two types of jank we measure.
   base::StatsCounter slow_processing_counter_;  // Msgs w/ long proc time.
   base::StatsCounter queueing_delay_counter_;   // Msgs w/ long queueing delay.
-  scoped_refptr<base::Histogram> process_times_;  // Time spent proc. task.
-  scoped_refptr<base::Histogram> total_times_;  // Total queueing plus proc.
+  base::Histogram* const process_times_;  // Time spent proc. task.
+  base::Histogram* const total_times_;  // Total queueing plus proc.
   JankWatchdog total_time_watchdog_;  // Watching for excessive total_time.
 
   DISALLOW_COPY_AND_ASSIGN(JankObserverHelper);
@@ -135,13 +135,13 @@
       events_till_measurement_(0),
       slow_processing_counter_(std::string("Chrome.SlowMsg") + thread_name),
       queueing_delay_counter_(std::string("Chrome.DelayMsg") + thread_name),
+      process_times_(base::Histogram::FactoryGet(
+          std::string("Chrome.ProcMsgL ") + thread_name,
+          1, 3600000, 50, base::Histogram::kUmaTargetedHistogramFlag)),
+      total_times_(base::Histogram::FactoryGet(
+          std::string("Chrome.TotalMsgL ") + thread_name,
+          1, 3600000, 50, base::Histogram::kUmaTargetedHistogramFlag)),
       total_time_watchdog_(excessive_duration, thread_name, watchdog_enable) {
-  process_times_ = base::Histogram::FactoryGet(
-      std::string("Chrome.ProcMsgL ") + thread_name,
-      1, 3600000, 50, base::Histogram::kUmaTargetedHistogramFlag);
-  total_times_ = base::Histogram::FactoryGet(
-      std::string("Chrome.TotalMsgL ") + thread_name,
-      1, 3600000, 50, base::Histogram::kUmaTargetedHistogramFlag);
   if (discard_count_ > 0) {
     // Select a vaguely random sample-start-point.
     events_till_measurement_ = static_cast<int>(