| 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_HISTOGRAM_BASE_H_ | 5 #ifndef BASE_METRICS_HISTOGRAM_BASE_H_ |
| 6 #define BASE_METRICS_HISTOGRAM_BASE_H_ | 6 #define BASE_METRICS_HISTOGRAM_BASE_H_ |
| 7 | 7 |
| 8 #include <limits.h> |
| 9 #include <stddef.h> |
| 8 #include <stdint.h> | 10 #include <stdint.h> |
| 9 | 11 |
| 10 #include <string> | 12 #include <string> |
| 11 #include <vector> | 13 #include <vector> |
| 12 | 14 |
| 13 #include "base/atomicops.h" | 15 #include "base/atomicops.h" |
| 14 #include "base/base_export.h" | 16 #include "base/base_export.h" |
| 15 #include "base/basictypes.h" | 17 #include "base/macros.h" |
| 16 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/strings/string_piece.h" | 19 #include "base/strings/string_piece.h" |
| 18 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 19 | 21 |
| 20 namespace base { | 22 namespace base { |
| 21 | 23 |
| 22 class DictionaryValue; | 24 class DictionaryValue; |
| 23 class HistogramBase; | 25 class HistogramBase; |
| 24 class HistogramSamples; | 26 class HistogramSamples; |
| 25 class ListValue; | 27 class ListValue; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // Subclasses should implement this function to make SerializeInfo work. | 164 // Subclasses should implement this function to make SerializeInfo work. |
| 163 virtual bool SerializeInfoImpl(base::Pickle* pickle) const = 0; | 165 virtual bool SerializeInfoImpl(base::Pickle* pickle) const = 0; |
| 164 | 166 |
| 165 // Writes information about the construction parameters in |params|. | 167 // Writes information about the construction parameters in |params|. |
| 166 virtual void GetParameters(DictionaryValue* params) const = 0; | 168 virtual void GetParameters(DictionaryValue* params) const = 0; |
| 167 | 169 |
| 168 // Writes information about the current (non-empty) buckets and their sample | 170 // Writes information about the current (non-empty) buckets and their sample |
| 169 // counts to |buckets|, the total sample count to |count| and the total sum | 171 // counts to |buckets|, the total sample count to |count| and the total sum |
| 170 // to |sum|. | 172 // to |sum|. |
| 171 virtual void GetCountAndBucketData(Count* count, | 173 virtual void GetCountAndBucketData(Count* count, |
| 172 int64* sum, | 174 int64_t* sum, |
| 173 ListValue* buckets) const = 0; | 175 ListValue* buckets) const = 0; |
| 174 | 176 |
| 175 //// Produce actual graph (set of blank vs non blank char's) for a bucket. | 177 //// Produce actual graph (set of blank vs non blank char's) for a bucket. |
| 176 void WriteAsciiBucketGraph(double current_size, | 178 void WriteAsciiBucketGraph(double current_size, |
| 177 double max_size, | 179 double max_size, |
| 178 std::string* output) const; | 180 std::string* output) const; |
| 179 | 181 |
| 180 // Return a string description of what goes in a given bucket. | 182 // Return a string description of what goes in a given bucket. |
| 181 const std::string GetSimpleAsciiBucketRange(Sample sample) const; | 183 const std::string GetSimpleAsciiBucketRange(Sample sample) const; |
| 182 | 184 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 193 private: | 195 private: |
| 194 const std::string histogram_name_; | 196 const std::string histogram_name_; |
| 195 AtomicCount flags_; | 197 AtomicCount flags_; |
| 196 | 198 |
| 197 DISALLOW_COPY_AND_ASSIGN(HistogramBase); | 199 DISALLOW_COPY_AND_ASSIGN(HistogramBase); |
| 198 }; | 200 }; |
| 199 | 201 |
| 200 } // namespace base | 202 } // namespace base |
| 201 | 203 |
| 202 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ | 204 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ |
| OLD | NEW |