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

Unified Diff: base/metrics/histogram_base.h

Issue 10830156: Skeleton code of SparseHistogram (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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
Index: base/metrics/histogram_base.h
===================================================================
--- base/metrics/histogram_base.h (revision 149721)
+++ base/metrics/histogram_base.h (working copy)
@@ -9,6 +9,7 @@
#include <string>
#include "base/base_export.h"
+#include "base/basictypes.h"
namespace base {
@@ -19,11 +20,32 @@
static const Sample kSampleType_MAX; // INT_MAX
+ enum Flags {
+ kNoFlags = 0,
+ kUmaTargetedHistogramFlag = 0x1, // Histogram should be UMA uploaded.
+
+ // Indicate that the histogram was pickled to be sent across an IPC Channel.
+ // If we observe this flag on a histogram being aggregated into after IPC,
+ // then we are running in a single process mode, and the aggregation should
+ // not take place (as we would be aggregating back into the source
+ // histogram!).
+ kIPCSerializationSourceFlag = 0x10,
+
+ // Only for Histogram and its sub classes: fancy bucket-naming support.
Ilya Sherman 2012/08/04 01:18:35 nit: It doesn't seem appropriate for HistogramBase
kaiwang 2012/08/08 03:59:33 agree... Let's keep this for code compatibility fo
+ kHexRangePrintingFlag = 0x8000,
+ };
+
+
HistogramBase(const std::string& name);
virtual ~HistogramBase();
std::string histogram_name() const { return histogram_name_; }
+ // Operations with Flags enum.
+ void SetFlags(int32 flags) { flags_ |= flags; }
+ void ClearFlags(int32 flags) { flags_ &= ~flags; }
Ilya Sherman 2012/08/04 01:18:35 nit: Please either write the function names in hac
kaiwang 2012/08/08 03:59:33 Will move to .cc file, so it will not affect other
+ int32 flags() const { return flags_; }
+
virtual void Add(Sample value) = 0;
// The following methods provide graphical histogram displays.
@@ -32,6 +54,7 @@
private:
const std::string histogram_name_;
+ int32 flags_;
};
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698