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

Issue 3173030: Http cache: It turns out that the cache destructor... (Closed)

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

Description

Http cache: It turns out that the cache destructor may be called from within one of the notifications of "backend construction done". This CL makes sure that this scenario is handled properly by invoking the callbacks one at a time, posting a task before moving on to the next one. BUG=52090 TEST=netunittests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=56964

Patch Set 1 #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -17 lines) Patch
M net/http/http_cache.cc View 3 chunks +32 lines, -17 lines 5 comments Download
M net/http/http_cache_unittest.cc View 1 chunk +55 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
rvargas (doing something else)
10 years, 4 months ago (2010-08-20 01:42:08 UTC) #1
eroman
lgtm http://codereview.chromium.org/3173030/diff/1/2 File net/http/http_cache.cc (right): http://codereview.chromium.org/3173030/diff/1/2#newcode1020 net/http/http_cache.cc:1020: if (backend_factory_.get()) { Can you add a comment ...
10 years, 4 months ago (2010-08-20 18:15:23 UTC) #2
rvargas (doing something else)
Thanks. http://codereview.chromium.org/3173030/diff/1/2 File net/http/http_cache.cc (right): http://codereview.chromium.org/3173030/diff/1/2#newcode1020 net/http/http_cache.cc:1020: if (backend_factory_.get()) { On 2010/08/20 18:15:23, eroman wrote: ...
10 years, 4 months ago (2010-08-20 18:47:38 UTC) #3
eroman
10 years, 4 months ago (2010-08-20 18:56:37 UTC) #4
http://codereview.chromium.org/3173030/diff/1/2
File net/http/http_cache.cc (right):

http://codereview.chromium.org/3173030/diff/1/2#newcode1038
net/http/http_cache.cc:1038: result, pending_op));
On 2010/08/20 18:47:38, rvargas wrote:
> On 2010/08/20 18:15:23, eroman wrote:
> > Won't this leak pending_op if HttpCache gets deleted before the callback is
> run?
> 
> No, it doesn't. pending_op is part of a list that is deleted by the destructor
> (DeletePendingOp removes the operation from that list).

Ah my bad. LGTM

Powered by Google App Engine
This is Rietveld 408576698