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

Unified Diff: net/disk_cache/stats.cc

Issue 10829466: SampleSet -> HistogramSamples (will be reused by SparseHistogram) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | « net/disk_cache/stats.h ('k') | net/disk_cache/stats_histogram.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/stats.cc
===================================================================
--- net/disk_cache/stats.cc (revision 155400)
+++ net/disk_cache/stats.cc (working copy)
@@ -6,6 +6,7 @@
#include "base/format_macros.h"
#include "base/logging.h"
+#include "base/metrics/histogram_samples.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "net/disk_cache/backend_impl.h"
@@ -150,9 +151,7 @@
backend->ShouldReportAgain()) {
// Stats may be reused when the cache is re-created, but we want only one
// histogram at any given time.
- size_histogram_ =
- StatsHistogram::FactoryGet("DiskCache.SizeStats");
- size_histogram_->Init(this);
+ size_histogram_ = StatsHistogram::FactoryGet("DiskCache.SizeStats", this);
}
}
@@ -264,13 +263,12 @@
return n;
}
-void Stats::Snapshot(StatsHistogram::StatsSamples* samples) const {
- samples->GetCounts()->resize(kDataSizesLength);
+void Stats::Snapshot(base::HistogramSamples* samples) const {
for (int i = 0; i < kDataSizesLength; i++) {
int count = data_sizes_[i];
if (count < 0)
count = 0;
- samples->GetCounts()->at(i) = count;
+ samples->Accumulate(GetBucketRange(i), count);
}
}
« no previous file with comments | « net/disk_cache/stats.h ('k') | net/disk_cache/stats_histogram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698