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

Issue 3054012: Disk Cache: Replace the backend pointer of the ChildrenDeleter... (Closed)

Created:
10 years, 5 months ago by rvargas (doing something else)
Modified:
9 years, 6 months ago
Reviewers:
gavinp
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Disk Cache: Replace the backend pointer of the ChildrenDeleter with a weak pointer to avoid crashing at shutdown. BUG=50082 TEST=net_unittests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=53838

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+67 lines, -5 lines) Patch
M net/disk_cache/backend_impl.h View 4 chunks +10 lines, -2 lines 0 comments Download
M net/disk_cache/backend_impl.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M net/disk_cache/entry_unittest.cc View 1 chunk +49 lines, -0 lines 4 comments Download
M net/disk_cache/sparse_control.cc View 4 chunks +6 lines, -3 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
rvargas (doing something else)
10 years, 5 months ago (2010-07-23 21:56:05 UTC) #1
gavinp
LGTM. Are there any other places that we should be tracking down ptrs to the ...
10 years, 5 months ago (2010-07-27 15:29:44 UTC) #2
rvargas (doing something else)
10 years, 5 months ago (2010-07-27 18:26:30 UTC) #3
Thanks.

I found out this issue by looking at other places that were doing PostTask after
fixing the last bug (in other words, not from a crash report).

As from other places that keep pointers to the backend, they should be deleted
directly by the backend destructor.

The only exception is an EntryImpl, but I don't think we should convert that
pointer to a weak one: when the cache goes away, surviving transactions should
stop issuing requests to any entry that they reference... and if we need to be
explicit about it, we already keep track of open entries so we could do
something when the backend goes away.

http://codereview.chromium.org/3054012/diff/1/4
File net/disk_cache/entry_unittest.cc (right):

http://codereview.chromium.org/3054012/diff/1/4#newcode1336
net/disk_cache/entry_unittest.cc:1336: cache_ = NULL;
On 2010/07/27 15:29:44, gavinp wrote:
> What does this do?
> 

We deleted the cache in the callback, but the test's TearDown doesn't know about
it and will attempt to destroy the object again. I added a comment.

Powered by Google App Engine
This is Rietveld 408576698