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

Unified Diff: base/metrics/histogram.h

Issue 2965083002: Reduce Histogram object size. (Closed)
Patch Set: added TODO to remove unnecessary parameters Created 3 years, 5 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 | base/metrics/histogram.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram.h
diff --git a/base/metrics/histogram.h b/base/metrics/histogram.h
index 78ab116ae20aede99f5135685f8cb977e89832ec..6e5821d4680fd5d57dcfcbf4065d9a9a841b5e4d 100644
--- a/base/metrics/histogram.h
+++ b/base/metrics/histogram.h
@@ -173,8 +173,8 @@ class BASE_EXPORT Histogram : public HistogramBase {
//----------------------------------------------------------------------------
// Accessors for factory construction, serialization and testing.
//----------------------------------------------------------------------------
- Sample declared_min() const { return declared_min_; }
- Sample declared_max() const { return declared_max_; }
+ Sample declared_min() const;
+ Sample declared_max() const;
virtual Sample ranges(uint32_t i) const;
virtual uint32_t bucket_count() const;
const BucketRanges* bucket_ranges() const { return bucket_ranges_; }
@@ -305,18 +305,17 @@ class BASE_EXPORT Histogram : public HistogramBase {
// Does not own this object. Should get from StatisticsRecorder.
const BucketRanges* bucket_ranges_;
- Sample declared_min_; // Less than this goes into the first bucket.
- Sample declared_max_; // Over this goes into the last bucket.
-
// Samples that have not yet been logged with SnapshotDelta().
std::unique_ptr<HistogramSamples> unlogged_samples_;
// Accumulation of all samples that have been logged with SnapshotDelta().
std::unique_ptr<HistogramSamples> logged_samples_;
+#if DCHECK_IS_ON() // Don't waste memory if it won't be used.
// Flag to indicate if PrepareFinalDelta has been previously called. It is
// used to DCHECK that a final delta is not created multiple times.
mutable bool final_delta_created_ = false;
+#endif
DISALLOW_COPY_AND_ASSIGN(Histogram);
};
« no previous file with comments | « no previous file | base/metrics/histogram.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698