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

Side by Side Diff: base/metrics/sparse_histogram.h

Issue 2867303004: [histogram] Make histograms more resistant to overflows. (Closed)
Patch Set: final final fix Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « base/metrics/histogram_unittest.cc ('k') | base/metrics/sparse_histogram.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_METRICS_SPARSE_HISTOGRAM_H_ 5 #ifndef BASE_METRICS_SPARSE_HISTOGRAM_H_
6 #define BASE_METRICS_SPARSE_HISTOGRAM_H_ 6 #define BASE_METRICS_SPARSE_HISTOGRAM_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 // For constuctor calling. 91 // For constuctor calling.
92 friend class SparseHistogramTest; 92 friend class SparseHistogramTest;
93 93
94 // Protects access to |samples_|. 94 // Protects access to |samples_|.
95 mutable base::Lock lock_; 95 mutable base::Lock lock_;
96 96
97 // Flag to indicate if PrepareFinalDelta has been previously called. 97 // Flag to indicate if PrepareFinalDelta has been previously called.
98 mutable bool final_delta_created_ = false; 98 mutable bool final_delta_created_ = false;
99 99
100 std::unique_ptr<HistogramSamples> samples_; 100 std::unique_ptr<HistogramSamples> unlogged_samples_;
101 std::unique_ptr<HistogramSamples> logged_samples_; 101 std::unique_ptr<HistogramSamples> logged_samples_;
102 102
103 DISALLOW_COPY_AND_ASSIGN(SparseHistogram); 103 DISALLOW_COPY_AND_ASSIGN(SparseHistogram);
104 }; 104 };
105 105
106 } // namespace base 106 } // namespace base
107 107
108 #endif // BASE_METRICS_SPARSE_HISTOGRAM_H_ 108 #endif // BASE_METRICS_SPARSE_HISTOGRAM_H_
OLDNEW
« no previous file with comments | « base/metrics/histogram_unittest.cc ('k') | base/metrics/sparse_histogram.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698