diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-18 18:54:53 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-18 18:54:53 +0000 |
commit | 98ceffa410220754ea90eb81a17d9e6c9502c875 (patch) | |
tree | e4edcaaec439468d38a14244ffce9eaf4b8c4b4c /net/disk_cache | |
parent | d1cddd75295c303b6bb2940ffcccb6887d3b9313 (diff) | |
download | chromium_src-98ceffa410220754ea90eb81a17d9e6c9502c875.zip chromium_src-98ceffa410220754ea90eb81a17d9e6c9502c875.tar.gz chromium_src-98ceffa410220754ea90eb81a17d9e6c9502c875.tar.bz2 |
Disk cache: Avoid a crashing on a timer when the cache is disabled.
Review URL: http://codereview.chromium.org/15025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7233 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache')
-rw-r--r-- | net/disk_cache/backend_impl.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index 710f8bd..af35041 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -682,9 +682,11 @@ void BackendImpl::OnStatsTimer() { stats_.SetCounter(Stats::MAX_ENTRIES, max_refs_); static bool first_time = true; + if (!data_) + first_time = false; if (first_time) { first_time = false; - int experiment = data_ ? data_->header.experiment : 1; + int experiment = data_->header.experiment; std::wstring entries(StringPrintf(L"DiskCache.Entries_%d", experiment)); std::wstring size(StringPrintf(L"DiskCache.Size_%d", experiment)); std::wstring max_size(StringPrintf(L"DiskCache.MaxSize_%d", experiment)); |