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

Issue 478573003: Connect SimpleCache Backend active_entries_ more closely to Entry lifetime. (Closed)

Created:
6 years, 4 months ago by gavinp
Modified:
6 years, 3 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, gavinp+disk_chromium.org
Project:
chromium
Visibility:
Public.

Description

Connect SimpleCache Backend active_entries_ more closely to Entry lifetime. Entries remove themselves from their backend's |active_entries_| at two distinct points in their lifetime; after a successful doom and on destruction. Entries are also added to |active_entries_| in one of two possible places; early in opening/creating an entry from its key, and during iteration, after successfully opening an entry from its hash alone. We weren't carefully tracking this relationship, and so entries previously would double remove themselves from the backend, which could create races that could cause entries to not open. For instance, creating an entry, dooming it, closing it, then creating a new entry with the same key could race, and the doom's completion would remove the closing entry from |active_entries_|, allowing a subsequent OpenEntry() to fail because it found an half baked entry. To avoid exposing the state of the backend to the entry, this patch introduces an abstraction to Entry to allow observation of destruction. This abstraction is then used to register the backend as entries are placed in |active_entries_|. R=jkarlin@chromium.org,ttuttle@chromium.org,pasko@chromium.org BUG=317138, 404676 Committed: https://crrev.com/b02ee6e3d42dc4181251bbf4c4df0e3cc91994f5 Cr-Commit-Position: refs/heads/master@{#291728}

Patch Set 1 #

Patch Set 2 : better #

Patch Set 3 : lint #

Patch Set 4 : using a scoper #

Patch Set 5 : remove dead function #

Patch Set 6 : remove inline destructor #

Total comments: 17

Patch Set 7 : began remediation #

Patch Set 8 : cleanup comments #

Patch Set 9 : one more comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -43 lines) Patch
M net/disk_cache/entry_unittest.cc View 1 2 1 chunk +32 lines, -0 lines 0 comments Download
M net/disk_cache/simple/simple_backend_impl.h View 1 2 3 4 5 6 2 chunks +4 lines, -5 lines 0 comments Download
M net/disk_cache/simple/simple_backend_impl.cc View 1 2 3 4 5 6 7 5 chunks +46 lines, -23 lines 0 comments Download
M net/disk_cache/simple/simple_entry_impl.h View 1 2 3 4 5 6 7 8 6 chunks +14 lines, -7 lines 0 comments Download
M net/disk_cache/simple/simple_entry_impl.cc View 1 2 3 4 5 6 4 chunks +9 lines, -8 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
gavinp
jkarlin, ttuttle: PTAL. pasko: FYI. This needs a unit test. jkarlin wrote https://codereview.chromium.org/485753002/ which works. ...
6 years, 4 months ago (2014-08-22 16:04:21 UTC) #1
gavinp
The latest upload adds a test. As well, I've removed WeakPtrs to SimpleEntryImpl, since we ...
6 years, 4 months ago (2014-08-22 17:05:36 UTC) #2
gavinp
And... I'm sorry to go all C++ey, however, I determined there was another complicated path ...
6 years, 4 months ago (2014-08-22 18:13:25 UTC) #3
Deprecated (see juliatuttle)
Please enjoy the following mix of substantive suggestions, constructive criticism, and completely arbitrary style nits. ...
6 years, 4 months ago (2014-08-22 19:26:38 UTC) #4
gavinp
Thanks for the review, ttuttle. I've significantly cleaned up comments and the code paths you ...
6 years, 4 months ago (2014-08-25 13:18:27 UTC) #5
Deprecated (see juliatuttle)
lgtm.
6 years, 4 months ago (2014-08-25 17:59:46 UTC) #6
gavinp
The CQ bit was checked by gavinp@chromium.org
6 years, 4 months ago (2014-08-25 18:06:50 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gavinp@chromium.org/478573003/160001
6 years, 4 months ago (2014-08-25 18:08:34 UTC) #8
commit-bot: I haz the power
Committed patchset #9 (160001) as 7bf7f493fdaf8c784266543344d75ffd7ac98138
6 years, 4 months ago (2014-08-25 19:03:23 UTC) #9
commit-bot: I haz the power
6 years, 3 months ago (2014-09-10 02:36:23 UTC) #10
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/b02ee6e3d42dc4181251bbf4c4df0e3cc91994f5
Cr-Commit-Position: refs/heads/master@{#291728}

Powered by Google App Engine
This is Rietveld 408576698