Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Unified Diff: base/metrics/histogram_base.h

Issue 511903003: Use precisely sized integer types in histograms code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram_base.h
diff --git a/base/metrics/histogram_base.h b/base/metrics/histogram_base.h
index be07fc6d419159ed684c506485532de60291ce6f..c24df248112cc5fd99d339278f1c8c3404239891 100644
--- a/base/metrics/histogram_base.h
+++ b/base/metrics/histogram_base.h
@@ -5,6 +5,8 @@
#ifndef BASE_METRICS_HISTOGRAM_BASE_H_
#define BASE_METRICS_HISTOGRAM_BASE_H_
+#include <stdint.h>
+
#include <string>
#include <vector>
@@ -49,9 +51,9 @@ BASE_EXPORT_PRIVATE HistogramBase* DeserializeHistogramInfo(
class BASE_EXPORT HistogramBase {
public:
- typedef int Sample; // Used for samples.
+ typedef int32_t Sample; // Used for samples.
typedef subtle::Atomic32 AtomicCount; // Used to count samples.
- typedef int32 Count; // Used to manipulate counts in temporaries.
+ typedef int32_t Count; // Used to manipulate counts in temporaries.
static const Sample kSampleType_MAX; // INT_MAX
@@ -99,9 +101,9 @@ class BASE_EXPORT HistogramBase {
void CheckName(const StringPiece& name) const;
// Operations with Flags enum.
- int32 flags() const { return flags_; }
- void SetFlags(int32 flags);
- void ClearFlags(int32 flags);
+ int32_t flags() const { return flags_; }
+ void SetFlags(int32_t flags);
+ void ClearFlags(int32_t flags);
virtual HistogramType GetHistogramType() const = 0;
@@ -173,7 +175,7 @@ class BASE_EXPORT HistogramBase {
private:
const std::string histogram_name_;
- int32 flags_;
+ int32_t flags_;
DISALLOW_COPY_AND_ASSIGN(HistogramBase);
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698