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

Unified Diff: base/test/histogram_tester.h

Issue 2796283005: Adding UseCounter specific for extensions (Closed)
Patch Set: Fix compile err Created 3 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/test/histogram_tester.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/histogram_tester.h
diff --git a/base/test/histogram_tester.h b/base/test/histogram_tester.h
index ecf33f831f0d1844531821a5face3c01ff30b198..1bd024c69f9f324538fdedb19a75c2aa646d3a68 100644
--- a/base/test/histogram_tester.h
+++ b/base/test/histogram_tester.h
@@ -78,6 +78,10 @@ class HistogramTester {
// histogram_tester.GetAllSamples("HistogramName"));
std::vector<Bucket> GetAllSamples(const std::string& name) const;
+ // Returns the value of the |sample| bucket for ths histogram |name|.
+ HistogramBase::Count GetBucketCount(const std::string& name,
+ HistogramBase::Sample sample) const;
+
// Finds histograms whose names start with |prefix|, and returns them along
// with the counts of any samples added since the creation of this object.
// Histograms that are unchanged are omitted from the result. The return value
@@ -119,6 +123,14 @@ class HistogramTester {
Histogram::Count expected_count,
const HistogramSamples& samples) const;
+ // Sets the value for |count| to be the value in the |sample| bucket. The
+ // bucket's current value is determined from |samples| and is modified based
+ // on the snapshot stored for histogram |name|.
+ void GetBucketCountForSamples(const std::string& name,
+ HistogramBase::Sample sample,
+ const HistogramSamples& samples,
+ HistogramBase::Count* count) const;
+
// Used to determine the histogram changes made during this instance's
// lifecycle.
std::map<std::string, std::unique_ptr<HistogramSamples>> histograms_snapshot_;
« no previous file with comments | « no previous file | base/test/histogram_tester.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698