Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3477)

Unified Diff: base/metrics/sample_map.cc

Issue 1485763002: Merge multiple histogram snapshots into single one for reporting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shared-histograms
Patch Set: added merge test Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/metrics/sample_map.cc
diff --git a/base/metrics/sample_map.cc b/base/metrics/sample_map.cc
index 437439e45384279803fb0b4af92229971ab664aa..5798dbc7eb26a6d5e206525e8054a576e8eb68c6 100644
--- a/base/metrics/sample_map.cc
+++ b/base/metrics/sample_map.cc
@@ -38,6 +38,11 @@ Count SampleMap::TotalCount() const {
return count;
}
+void SampleMap::Negate() {
+ for (auto& entry : sample_counts_)
Alexei Svitkine (slow) 2015/12/04 18:30:11 Nit: const auto&
bcwhite 2015/12/08 17:32:18 Can't be "const" because it's being changed.
+ entry.second = -entry.second;
+}
+
scoped_ptr<SampleCountIterator> SampleMap::Iterator() const {
return scoped_ptr<SampleCountIterator>(new SampleMapIterator(sample_counts_));
}

Powered by Google App Engine
This is Rietveld 408576698