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

Unified Diff: base/metrics/histogram.cc

Issue 1002103004: NOT FOR REVIEW - Slow Reports Reference Implementation Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: JSON serialization. Created 5 years, 7 months 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
« no previous file with comments | « no previous file | base/metrics/histogram_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram.cc
diff --git a/base/metrics/histogram.cc b/base/metrics/histogram.cc
index 42ced3d0abc2d366d7c077c349d5ff91c00f64fe..aeb0b70327208ac3beda9ca26180713539f64d3e 100644
--- a/base/metrics/histogram.cc
+++ b/base/metrics/histogram.cc
@@ -265,6 +265,9 @@ void Histogram::Add(int value) {
if (value < 0)
value = 0;
samples_->Accumulate(value, 1);
+
+ if (UNLIKELY(!callback_.is_null()))
+ callback_.Run();
}
scoped_ptr<HistogramSamples> Histogram::SnapshotSamples() const {
« no previous file with comments | « no previous file | base/metrics/histogram_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698