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

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

Issue 11682003: Serialize/Deserialize support in HistogramBase (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another friend change Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « base/metrics/histogram_unittest.cc ('k') | base/metrics/sample_map.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 // SampleMap implements HistogramSamples interface. It is used by the 5 // SampleMap implements HistogramSamples interface. It is used by the
6 // SparseHistogram class to store samples. 6 // SparseHistogram class to store samples.
7 7
8 #ifndef BASE_METRICS_SAMPLE_MAP_H_ 8 #ifndef BASE_METRICS_SAMPLE_MAP_H_
9 #define BASE_METRICS_SAMPLE_MAP_H_ 9 #define BASE_METRICS_SAMPLE_MAP_H_
10 10
(...skipping 12 matching lines...) Expand all
23 virtual ~SampleMap(); 23 virtual ~SampleMap();
24 24
25 // HistogramSamples implementation: 25 // HistogramSamples implementation:
26 virtual void Accumulate(HistogramBase::Sample value, 26 virtual void Accumulate(HistogramBase::Sample value,
27 HistogramBase::Count count) OVERRIDE; 27 HistogramBase::Count count) OVERRIDE;
28 virtual HistogramBase::Count GetCount( 28 virtual HistogramBase::Count GetCount(
29 HistogramBase::Sample value) const OVERRIDE; 29 HistogramBase::Sample value) const OVERRIDE;
30 virtual HistogramBase::Count TotalCount() const OVERRIDE; 30 virtual HistogramBase::Count TotalCount() const OVERRIDE;
31 virtual scoped_ptr<SampleCountIterator> Iterator() const OVERRIDE; 31 virtual scoped_ptr<SampleCountIterator> Iterator() const OVERRIDE;
32 32
33 void ResetRedundantCount(HistogramBase::Count count);
34
35 protected: 33 protected:
36 virtual bool AddSubtractImpl( 34 virtual bool AddSubtractImpl(
37 SampleCountIterator* iter, 35 SampleCountIterator* iter,
38 HistogramSamples::Operator op) OVERRIDE; // |op| is ADD or SUBTRACT. 36 HistogramSamples::Operator op) OVERRIDE; // |op| is ADD or SUBTRACT.
39 37
40 private: 38 private:
41 std::map<HistogramBase::Sample, HistogramBase::Count> sample_counts_; 39 std::map<HistogramBase::Sample, HistogramBase::Count> sample_counts_;
42 40
43 DISALLOW_COPY_AND_ASSIGN(SampleMap); 41 DISALLOW_COPY_AND_ASSIGN(SampleMap);
44 }; 42 };
(...skipping 13 matching lines...) Expand all
58 HistogramBase::Sample* max, 56 HistogramBase::Sample* max,
59 HistogramBase::Count* count) const OVERRIDE; 57 HistogramBase::Count* count) const OVERRIDE;
60 private: 58 private:
61 SampleToCountMap::const_iterator iter_; 59 SampleToCountMap::const_iterator iter_;
62 const SampleToCountMap::const_iterator end_; 60 const SampleToCountMap::const_iterator end_;
63 }; 61 };
64 62
65 } // namespace base 63 } // namespace base
66 64
67 #endif // BASE_METRICS_SAMPLE_MAP_H_ 65 #endif // BASE_METRICS_SAMPLE_MAP_H_
OLDNEW
« no previous file with comments | « base/metrics/histogram_unittest.cc ('k') | base/metrics/sample_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698