Re-land https://codereview.chromium.org/23602005: Use nobarrier atomics for lossy counters in base::HistogramSamples and base::SampleVector

This should not affect the performance, but will make it explicit that the counter values are expected to be read and written atomically.
This will also suppress the ThreadSanitizer v2 reports on these counters.

BUG=46840
[email protected]

Review URL: https://codereview.chromium.org/23450016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221183 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/base/metrics/histogram_base.h b/base/metrics/histogram_base.h
index f5448e7..4663647 100644
--- a/base/metrics/histogram_base.h
+++ b/base/metrics/histogram_base.h
@@ -7,6 +7,7 @@
 
 #include <string>
 
+#include "base/atomicops.h"
 #include "base/base_export.h"
 #include "base/basictypes.h"
 #include "base/memory/scoped_ptr.h"
@@ -50,8 +51,8 @@
 
 class BASE_EXPORT HistogramBase {
  public:
-  typedef int Sample;  // Used for samples.
-  typedef int Count;   // Used to count samples.
+  typedef int Sample;                   // Used for samples.
+  typedef subtle::Atomic32 Count;     // Used to count samples.
 
   static const Sample kSampleType_MAX;  // INT_MAX