| 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 #include "base/metrics/histogram_snapshot_manager.h" | 5 #include "base/metrics/histogram_snapshot_manager.h" |
| 6 | 6 |
| 7 #include "base/metrics/statistics_recorder.h" |
| 8 |
| 7 using base::Histogram; | 9 using base::Histogram; |
| 8 using base::StatisticsRecorder; | 10 using base::StatisticsRecorder; |
| 9 | 11 |
| 10 namespace base { | 12 namespace base { |
| 11 | 13 |
| 12 HistogramSnapshotManager::HistogramSnapshotManager( | 14 HistogramSnapshotManager::HistogramSnapshotManager( |
| 13 HistogramFlattener* histogram_flattener) | 15 HistogramFlattener* histogram_flattener) |
| 14 : histogram_flattener_(histogram_flattener) { | 16 : histogram_flattener_(histogram_flattener) { |
| 15 DCHECK(histogram_flattener_); | 17 DCHECK(histogram_flattener_); |
| 16 } | 18 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 97 } |
| 96 | 98 |
| 97 // Snapshot now contains only a delta to what we've already_logged. | 99 // Snapshot now contains only a delta to what we've already_logged. |
| 98 if (snapshot.redundant_count() > 0) { | 100 if (snapshot.redundant_count() > 0) { |
| 99 histogram_flattener_->RecordDelta(histogram, snapshot); | 101 histogram_flattener_->RecordDelta(histogram, snapshot); |
| 100 // Add new data into our running total. | 102 // Add new data into our running total. |
| 101 already_logged->Add(snapshot); | 103 already_logged->Add(snapshot); |
| 102 } | 104 } |
| 103 } | 105 } |
| 104 } // namespace base | 106 } // namespace base |
| OLD | NEW |