| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/atomicops.h" |
| 10 #include "base/base_export.h" | 11 #include "base/base_export.h" |
| 11 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 14 | 15 |
| 15 class Pickle; | 16 class Pickle; |
| 16 class PickleIterator; | 17 class PickleIterator; |
| 17 | 18 |
| 18 namespace base { | 19 namespace base { |
| 19 | 20 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 43 PickleIterator* iter); | 44 PickleIterator* iter); |
| 44 | 45 |
| 45 // Create or find existing histogram and add the samples from pickle. | 46 // Create or find existing histogram and add the samples from pickle. |
| 46 // Silently returns when seeing any data problem in the pickle. | 47 // Silently returns when seeing any data problem in the pickle. |
| 47 BASE_EXPORT void DeserializeHistogramAndAddSamples(PickleIterator* iter); | 48 BASE_EXPORT void DeserializeHistogramAndAddSamples(PickleIterator* iter); |
| 48 | 49 |
| 49 //////////////////////////////////////////////////////////////////////////////// | 50 //////////////////////////////////////////////////////////////////////////////// |
| 50 | 51 |
| 51 class BASE_EXPORT HistogramBase { | 52 class BASE_EXPORT HistogramBase { |
| 52 public: | 53 public: |
| 53 typedef int Sample; // Used for samples. | 54 typedef int Sample; // Used for samples. |
| 54 typedef int Count; // Used to count samples. | 55 typedef subtle::Atomic32 Count; // Used to count samples. |
| 55 | 56 |
| 56 static const Sample kSampleType_MAX; // INT_MAX | 57 static const Sample kSampleType_MAX; // INT_MAX |
| 57 | 58 |
| 58 enum Flags { | 59 enum Flags { |
| 59 kNoFlags = 0, | 60 kNoFlags = 0, |
| 60 kUmaTargetedHistogramFlag = 0x1, // Histogram should be UMA uploaded. | 61 kUmaTargetedHistogramFlag = 0x1, // Histogram should be UMA uploaded. |
| 61 | 62 |
| 62 // Indicate that the histogram was pickled to be sent across an IPC Channel. | 63 // Indicate that the histogram was pickled to be sent across an IPC Channel. |
| 63 // If we observe this flag on a histogram being aggregated into after IPC, | 64 // If we observe this flag on a histogram being aggregated into after IPC, |
| 64 // then we are running in a single process mode, and the aggregation should | 65 // then we are running in a single process mode, and the aggregation should |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 private: | 163 private: |
| 163 const std::string histogram_name_; | 164 const std::string histogram_name_; |
| 164 int32 flags_; | 165 int32 flags_; |
| 165 | 166 |
| 166 DISALLOW_COPY_AND_ASSIGN(HistogramBase); | 167 DISALLOW_COPY_AND_ASSIGN(HistogramBase); |
| 167 }; | 168 }; |
| 168 | 169 |
| 169 } // namespace base | 170 } // namespace base |
| 170 | 171 |
| 171 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ | 172 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ |
| OLD | NEW |