Index: base/metrics/histogram_snapshot_manager.cc |
diff --git a/base/metrics/histogram_snapshot_manager.cc b/base/metrics/histogram_snapshot_manager.cc |
index e21d512daba271dc43248a9e63b598ce98d55472..7c6b906cf59da131165315f4541fda24b3555f50 100644 |
--- a/base/metrics/histogram_snapshot_manager.cc |
+++ b/base/metrics/histogram_snapshot_manager.cc |
@@ -31,10 +31,11 @@ void HistogramSnapshotManager::StartDeltas() { |
DCHECK(owned_histograms_.empty()); |
-#ifdef DEBUG |
- CHECK(!iter->second.histogram); |
- CHECK(!iter->second.accumulated_samples); |
- CHECK(!(iter->second.inconsistencies & |
+#if DCHECK_IS_ON() |
+ for (const auto& hash_and_info : known_histograms_) { |
+ CHECK(!hash_and_info.second.histogram); |
+ CHECK(!hash_and_info.second.accumulated_samples); |
+ CHECK(!(hash_and_info.second.inconsistencies & |
Ilya Sherman
2016/05/05 07:22:37
Should these be DCHECKs? It's odd for them to be
bcwhite
2016/05/05 16:01:17
They could be. Didn't seem to be any difference.
|
HistogramBase::NEW_INCONSISTENCY_FOUND)); |
} |
#endif |
@@ -60,6 +61,12 @@ void HistogramSnapshotManager::PrepareAbsoluteTakingOwnership( |
owned_histograms_.push_back(std::move(histogram)); |
} |
+void HistogramSnapshotManager::PrepareFinalDeltaTakingOwnership( |
+ std::unique_ptr<const HistogramBase> histogram) { |
+ PrepareSamples(histogram.get(), histogram->SnapshotFinalDelta()); |
+ owned_histograms_.push_back(std::move(histogram)); |
+} |
+ |
void HistogramSnapshotManager::FinishDeltas() { |
DCHECK(preparing_deltas_); |