From c30a6232df03e1efbd9f3b226777b07e087a1122 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 12 Oct 2020 14:27:29 +0200 Subject: BASELINE: Update Chromium to 85.0.4183.140 Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen --- chromium/base/metrics/histogram_base.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'chromium/base/metrics/histogram_base.cc') diff --git a/chromium/base/metrics/histogram_base.cc b/chromium/base/metrics/histogram_base.cc index 8d55e92e1dd..ce7fbf16e38 100644 --- a/chromium/base/metrics/histogram_base.cc +++ b/chromium/base/metrics/histogram_base.cc @@ -179,6 +179,30 @@ void HistogramBase::FindAndRunCallback(HistogramBase::Sample sample) const { cb.Run(sample); } +void HistogramBase::GetCountAndBucketData(Count* count, + int64_t* sum, + ListValue* buckets) const { + std::unique_ptr snapshot = SnapshotSamples(); + *count = snapshot->TotalCount(); + *sum = snapshot->sum(); + std::unique_ptr it = snapshot->Iterator(); + uint32_t index = 0; + while (!it->Done()) { + std::unique_ptr bucket_value(new DictionaryValue()); + Sample bucket_min; + int64_t bucket_max; + Count bucket_count; + it->Get(&bucket_min, &bucket_max, &bucket_count); + + bucket_value->SetIntKey("low", bucket_min); + bucket_value->SetIntKey("high", bucket_max); + bucket_value->SetIntKey("count", bucket_count); + buckets->Set(index, std::move(bucket_value)); + it->Next(); + ++index; + } +} + void HistogramBase::WriteAsciiBucketGraph(double current_size, double max_size, std::string* output) const { -- cgit v1.2.1