summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/stats_histogram.cc
diff options
context:
space:
mode:
authorrvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-03 19:46:21 +0000
committerrvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-03 19:46:21 +0000
commitbca77414e34b5d210c1b556441064cf2ae61ffbe (patch)
treeed3a7052512ccd4ce8be4291251e7f435b9b9b03 /net/disk_cache/stats_histogram.cc
parent38a70770afcb505f184842be7b8b980e3eb07668 (diff)
downloadchromium_src-bca77414e34b5d210c1b556441064cf2ae61ffbe.zip
chromium_src-bca77414e34b5d210c1b556441064cf2ae61ffbe.tar.gz
chromium_src-bca77414e34b5d210c1b556441064cf2ae61ffbe.tar.bz2
Disk cache: Make sure the size stats ate not used after the backend goes away.
BUG=275799 TEST=none R=jar@chromium.org Review URL: https://chromiumcodereview.appspot.com/23658006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221001 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/stats_histogram.cc')
-rw-r--r--net/disk_cache/stats_histogram.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/disk_cache/stats_histogram.cc b/net/disk_cache/stats_histogram.cc
index 33adfea..2a67550 100644
--- a/net/disk_cache/stats_histogram.cc
+++ b/net/disk_cache/stats_histogram.cc
@@ -70,9 +70,14 @@ StatsHistogram* StatsHistogram::FactoryGet(const std::string& name,
return return_histogram;
}
+void StatsHistogram::Disable() {
+ stats_ = NULL;
+}
+
scoped_ptr<HistogramSamples> StatsHistogram::SnapshotSamples() const {
scoped_ptr<SampleVector> samples(new SampleVector(bucket_ranges()));
- stats_->Snapshot(samples.get());
+ if (stats_)
+ stats_->Snapshot(samples.get());
// Only report UMA data once.
StatsHistogram* mutable_me = const_cast<StatsHistogram*>(this);