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

Unified Diff: base/metrics/histogram_base.cc

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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 | « base/metrics/histogram_base.h ('k') | base/metrics/histogram_macros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram_base.cc
diff --git a/base/metrics/histogram_base.cc b/base/metrics/histogram_base.cc
index de34c79d4b4bfde9b063654e17e7db2cc880f38c..6b3f69c2c047a63198d6cf69e94ec6e29336e8b7 100644
--- a/base/metrics/histogram_base.cc
+++ b/base/metrics/histogram_base.cc
@@ -12,6 +12,7 @@
#include "base/metrics/histogram.h"
#include "base/metrics/histogram_samples.h"
#include "base/metrics/sparse_histogram.h"
+#include "base/metrics/statistics_recorder.h"
#include "base/pickle.h"
#include "base/process/process_handle.h"
#include "base/strings/stringprintf.h"
@@ -117,6 +118,16 @@ void HistogramBase::WriteJSON(std::string* output) const {
serializer.Serialize(root);
}
+void HistogramBase::FindAndRunCallback(HistogramBase::Sample sample) const {
+ if ((flags_ & kCallbackExists) == 0)
+ return;
+
+ StatisticsRecorder::OnSampleCallback cb =
+ StatisticsRecorder::FindCallback(histogram_name());
+ if (!cb.is_null())
+ cb.Run(sample);
+}
+
void HistogramBase::WriteAsciiBucketGraph(double current_size,
double max_size,
std::string* output) const {
« no previous file with comments | « base/metrics/histogram_base.h ('k') | base/metrics/histogram_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698