| 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_SNAPSHOT_MANAGER_H_ | 5 #ifndef BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_ |
| 6 #define BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_ | 6 #define BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/metrics/histogram_base.h" | 16 #include "base/metrics/histogram_base.h" |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 | 19 |
| 20 class HistogramSamples; | 20 class HistogramSamples; |
| 21 class HistogramFlattener; | 21 class HistogramFlattener; |
| 22 | 22 |
| 23 // HistogramSnapshotManager handles the logistics of gathering up available | 23 // HistogramSnapshotManager handles the logistics of gathering up available |
| 24 // histograms for recording either to disk or for transmission (such as from | 24 // histograms for recording either to disk or for transmission (such as from |
| 25 // renderer to browser, or from browser to UMA upload). Since histograms can sit | 25 // renderer to browser, or from browser to UMA upload). Since histograms can sit |
| 26 // in memory for an extended period of time, and are vulnerable to memory | 26 // in memory for an extended period of time, and are vulnerable to memory |
| 27 // corruption, this class also validates as much rendundancy as it can before | 27 // corruption, this class also validates as much redundancy as it can before |
| 28 // calling for the marginal change (a.k.a., delta) in a histogram to be | 28 // calling for the marginal change (a.k.a., delta) in a histogram to be |
| 29 // recorded. | 29 // recorded. |
| 30 class BASE_EXPORT HistogramSnapshotManager { | 30 class BASE_EXPORT HistogramSnapshotManager { |
| 31 public: | 31 public: |
| 32 explicit HistogramSnapshotManager(HistogramFlattener* histogram_flattener); | 32 explicit HistogramSnapshotManager(HistogramFlattener* histogram_flattener); |
| 33 virtual ~HistogramSnapshotManager(); | 33 virtual ~HistogramSnapshotManager(); |
| 34 | 34 |
| 35 // Snapshot all histograms, and ask |histogram_flattener_| to record the | 35 // Snapshot all histograms, and ask |histogram_flattener_| to record the |
| 36 // delta. |flags_to_set| is used to set flags for each histogram. | 36 // delta. |flags_to_set| is used to set flags for each histogram. |
| 37 // |required_flags| is used to select histograms to be recorded. | 37 // |required_flags| is used to select histograms to be recorded. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // |histogram_flattener_| handles the logistics of recording the histogram | 87 // |histogram_flattener_| handles the logistics of recording the histogram |
| 88 // deltas. | 88 // deltas. |
| 89 HistogramFlattener* histogram_flattener_; // Weak. | 89 HistogramFlattener* histogram_flattener_; // Weak. |
| 90 | 90 |
| 91 DISALLOW_COPY_AND_ASSIGN(HistogramSnapshotManager); | 91 DISALLOW_COPY_AND_ASSIGN(HistogramSnapshotManager); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace base | 94 } // namespace base |
| 95 | 95 |
| 96 #endif // BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_ | 96 #endif // BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_ |
| OLD | NEW |