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 CHROME_COMMON_METRICS_METRICS_SERVICE_BASE_H_ | 5 #ifndef CHROME_COMMON_METRICS_METRICS_SERVICE_BASE_H_ |
6 #define CHROME_COMMON_METRICS_METRICS_SERVICE_BASE_H_ | 6 #define CHROME_COMMON_METRICS_METRICS_SERVICE_BASE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/metrics/histogram_flattener.h" | 10 #include "base/metrics/histogram_flattener.h" |
11 #include "base/metrics/histogram_snapshot_manager.h" | 11 #include "base/metrics/histogram_snapshot_manager.h" |
12 #include "chrome/common/metrics/metrics_log_manager.h" | 12 #include "chrome/common/metrics/metrics_log_manager.h" |
13 | 13 |
| 14 namespace base { |
| 15 class HistogramSamples; |
| 16 } // namespace base |
| 17 |
14 // This class provides base functionality for logging metrics data. | 18 // This class provides base functionality for logging metrics data. |
15 // TODO(ananta): Factor out more common code from chrome and chrome frame | 19 // TODO(ananta): Factor out more common code from chrome and chrome frame |
16 // metrics service into this class. | 20 // metrics service into this class. |
17 class MetricsServiceBase : public base::HistogramFlattener { | 21 class MetricsServiceBase : public base::HistogramFlattener { |
18 public: | 22 public: |
19 // HistogramFlattener interface (override) methods. | 23 // HistogramFlattener interface (override) methods. |
20 virtual void RecordDelta(const base::Histogram& histogram, | 24 virtual void RecordDelta(const base::Histogram& histogram, |
21 const base::Histogram::SampleSet& snapshot) OVERRIDE; | 25 const base::HistogramSamples& snapshot) OVERRIDE; |
22 virtual void InconsistencyDetected( | 26 virtual void InconsistencyDetected( |
23 base::Histogram::Inconsistencies problem) OVERRIDE; | 27 base::Histogram::Inconsistencies problem) OVERRIDE; |
24 virtual void UniqueInconsistencyDetected( | 28 virtual void UniqueInconsistencyDetected( |
25 base::Histogram::Inconsistencies problem) OVERRIDE; | 29 base::Histogram::Inconsistencies problem) OVERRIDE; |
26 virtual void InconsistencyDetectedInLoggedCount(int amount) OVERRIDE; | 30 virtual void InconsistencyDetectedInLoggedCount(int amount) OVERRIDE; |
27 | 31 |
28 protected: | 32 protected: |
29 MetricsServiceBase(); | 33 MetricsServiceBase(); |
30 virtual ~MetricsServiceBase(); | 34 virtual ~MetricsServiceBase(); |
31 | 35 |
(...skipping 13 matching lines...) Expand all Loading... |
45 MetricsLogManager log_manager_; | 49 MetricsLogManager log_manager_; |
46 | 50 |
47 private: | 51 private: |
48 // |histogram_snapshot_manager_| prepares histogram deltas for transmission. | 52 // |histogram_snapshot_manager_| prepares histogram deltas for transmission. |
49 base::HistogramSnapshotManager histogram_snapshot_manager_; | 53 base::HistogramSnapshotManager histogram_snapshot_manager_; |
50 | 54 |
51 DISALLOW_COPY_AND_ASSIGN(MetricsServiceBase); | 55 DISALLOW_COPY_AND_ASSIGN(MetricsServiceBase); |
52 }; | 56 }; |
53 | 57 |
54 #endif // CHROME_COMMON_METRICS_METRICS_SERVICE_BASE_H_ | 58 #endif // CHROME_COMMON_METRICS_METRICS_SERVICE_BASE_H_ |
OLD | NEW |