From 65188eb51c19157f9b360c84acbfa66543f0d781 Mon Sep 17 00:00:00 2001 From: "rvargas@google.com" Date: Thu, 16 Sep 2010 20:59:29 +0000 Subject: Disk cache: Fix the order in which we delete data from the block files. Stress testing the cache reveals a problem with the deletion of some data from an entry: it is possible to crash in a way that the block file thinks a block is free and an entry thinks the block is in use. This CL corrects that issue. There is also some new tests and a bunch of DCHECKS added while looking for the problem, as well as adding tests to make sure that a block file is accessed only from one thread (there is no problem with the current code in that regard) BUG=55605 TEST=netunittests Review URL: http://codereview.chromium.org/3430004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59711 0039d316-1c4b-4281-b951-d872f2087c98 --- net/disk_cache/stats.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'net/disk_cache/stats.cc') diff --git a/net/disk_cache/stats.cc b/net/disk_cache/stats.cc index e69ea00..b69e70d 100644 --- a/net/disk_cache/stats.cc +++ b/net/disk_cache/stats.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -147,8 +147,10 @@ bool Stats::Init(BackendImpl* backend, uint32* storage_addr) { return true; } +Stats::Stats() : backend_(NULL) { +} + Stats::~Stats() { - Store(); } // The array will be filled this way: -- cgit v1.1