OLD | NEW |
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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 class BASE_EXPORT_PRIVATE SparseHistogram : public HistogramBase { | 57 class BASE_EXPORT_PRIVATE SparseHistogram : public HistogramBase { |
58 public: | 58 public: |
59 // If there's one with same name, return the existing one. If not, create a | 59 // If there's one with same name, return the existing one. If not, create a |
60 // new one. | 60 // new one. |
61 static HistogramBase* FactoryGet(const std::string& name, int32 flags); | 61 static HistogramBase* FactoryGet(const std::string& name, int32 flags); |
62 | 62 |
63 virtual ~SparseHistogram(); | 63 virtual ~SparseHistogram(); |
64 | 64 |
65 // HistogramBase implementation: | 65 // HistogramBase implementation: |
66 virtual HistogramType GetHistogramType() const OVERRIDE; | 66 virtual HistogramType GetHistogramType() const OVERRIDE; |
67 virtual bool HasConstructionArguments(Sample minimum, | 67 virtual bool HasConstructionArguments( |
68 Sample maximum, | 68 Sample expected_minimum, |
69 size_t bucket_count) const OVERRIDE; | 69 Sample expected_maximum, |
| 70 size_t expected_bucket_count) const OVERRIDE; |
70 virtual void Add(Sample value) OVERRIDE; | 71 virtual void Add(Sample value) OVERRIDE; |
71 virtual void AddSamples(const HistogramSamples& samples) OVERRIDE; | 72 virtual void AddSamples(const HistogramSamples& samples) OVERRIDE; |
72 virtual bool AddSamplesFromPickle(PickleIterator* iter) OVERRIDE; | 73 virtual bool AddSamplesFromPickle(PickleIterator* iter) OVERRIDE; |
73 virtual scoped_ptr<HistogramSamples> SnapshotSamples() const OVERRIDE; | 74 virtual scoped_ptr<HistogramSamples> SnapshotSamples() const OVERRIDE; |
74 virtual void WriteHTMLGraph(std::string* output) const OVERRIDE; | 75 virtual void WriteHTMLGraph(std::string* output) const OVERRIDE; |
75 virtual void WriteAscii(std::string* output) const OVERRIDE; | 76 virtual void WriteAscii(std::string* output) const OVERRIDE; |
76 | 77 |
77 protected: | 78 protected: |
78 // HistogramBase implementation: | 79 // HistogramBase implementation: |
79 virtual bool SerializeInfoImpl(Pickle* pickle) const OVERRIDE; | 80 virtual bool SerializeInfoImpl(Pickle* pickle) const OVERRIDE; |
(...skipping 27 matching lines...) Expand all Loading... |
107 mutable base::Lock lock_; | 108 mutable base::Lock lock_; |
108 | 109 |
109 SampleMap samples_; | 110 SampleMap samples_; |
110 | 111 |
111 DISALLOW_COPY_AND_ASSIGN(SparseHistogram); | 112 DISALLOW_COPY_AND_ASSIGN(SparseHistogram); |
112 }; | 113 }; |
113 | 114 |
114 } // namespace base | 115 } // namespace base |
115 | 116 |
116 #endif // BASE_METRICS_SPARSE_HISTOGRAM_H_ | 117 #endif // BASE_METRICS_SPARSE_HISTOGRAM_H_ |
OLD | NEW |