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> | 8 #include <limits.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/atomicops.h" | 15 #include "base/atomicops.h" |
16 #include "base/base_export.h" | 16 #include "base/base_export.h" |
17 #include "base/macros.h" | 17 #include "base/macros.h" |
18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
19 #include "base/strings/string_piece.h" | 19 #include "base/strings/string_piece.h" |
20 #include "base/time/time.h" | 20 #include "base/time/time.h" |
21 | 21 |
22 namespace base { | 22 namespace base { |
23 | 23 |
| 24 class BucketRanges; |
24 class DictionaryValue; | 25 class DictionaryValue; |
25 class HistogramBase; | 26 class HistogramBase; |
26 class HistogramSamples; | 27 class HistogramSamples; |
27 class ListValue; | 28 class ListValue; |
28 class Pickle; | 29 class Pickle; |
29 class PickleIterator; | 30 class PickleIterator; |
30 | 31 |
31 //////////////////////////////////////////////////////////////////////////////// | 32 //////////////////////////////////////////////////////////////////////////////// |
32 // These enums are used to facilitate deserialization of histograms from other | 33 // These enums are used to facilitate deserialization of histograms from other |
33 // processes into the browser. If you create another class that inherits from | 34 // processes into the browser. If you create another class that inherits from |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // aggregation should not take place (as we would be aggregating back into | 75 // aggregation should not take place (as we would be aggregating back into |
75 // the source histogram!). | 76 // the source histogram!). |
76 kIPCSerializationSourceFlag = 0x10, | 77 kIPCSerializationSourceFlag = 0x10, |
77 | 78 |
78 // Indicates that a callback exists for when a new sample is recorded on | 79 // Indicates that a callback exists for when a new sample is recorded on |
79 // this histogram. We store this as a flag with the histogram since | 80 // this histogram. We store this as a flag with the histogram since |
80 // histograms can be in performance critical code, and this allows us | 81 // histograms can be in performance critical code, and this allows us |
81 // to shortcut looking up the callback if it doesn't exist. | 82 // to shortcut looking up the callback if it doesn't exist. |
82 kCallbackExists = 0x20, | 83 kCallbackExists = 0x20, |
83 | 84 |
| 85 // Indicates that the histogram is held in "persistent" memory and may |
| 86 // be accessible between processes. This is only possible if such a |
| 87 // memory segment has been created/attached, used to create a Persistent- |
| 88 // MemoryAllocator, and that loaded into the Histogram module before this |
| 89 // histogram is created. |
| 90 kIsPersistent = 0x40, |
| 91 |
84 // Only for Histogram and its sub classes: fancy bucket-naming support. | 92 // Only for Histogram and its sub classes: fancy bucket-naming support. |
85 kHexRangePrintingFlag = 0x8000, | 93 kHexRangePrintingFlag = 0x8000, |
86 }; | 94 }; |
87 | 95 |
88 // Histogram data inconsistency types. | 96 // Histogram data inconsistency types. |
89 enum Inconsistency { | 97 enum Inconsistency { |
90 NO_INCONSISTENCIES = 0x0, | 98 NO_INCONSISTENCIES = 0x0, |
91 RANGE_CHECKSUM_ERROR = 0x1, | 99 RANGE_CHECKSUM_ERROR = 0x1, |
92 BUCKET_ORDER_ERROR = 0x2, | 100 BUCKET_ORDER_ERROR = 0x2, |
93 COUNT_HIGH_ERROR = 0x4, | 101 COUNT_HIGH_ERROR = 0x4, |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 private: | 203 private: |
196 const std::string histogram_name_; | 204 const std::string histogram_name_; |
197 AtomicCount flags_; | 205 AtomicCount flags_; |
198 | 206 |
199 DISALLOW_COPY_AND_ASSIGN(HistogramBase); | 207 DISALLOW_COPY_AND_ASSIGN(HistogramBase); |
200 }; | 208 }; |
201 | 209 |
202 } // namespace base | 210 } // namespace base |
203 | 211 |
204 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ | 212 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ |
OLD | NEW |