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

Issue 8633001: Http Cache: Make sure that we don't switch to mode NONE when (Closed)

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

Description

Http Cache: Make sure that we don't switch to mode NONE when StopCaching is called if there is no network transaction, or the entry is sparse. BUG=105041, 22900 TEST=net_unittests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=111181

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -1 line) Patch
M net/http/http_cache_transaction.cc View 1 chunk +2 lines, -1 line 2 comments Download
M net/http/http_cache_unittest.cc View 1 chunk +54 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
rvargas (doing something else)
9 years, 1 month ago (2011-11-22 02:21:57 UTC) #1
gavinp
LGTM http://codereview.chromium.org/8633001/diff/1/net/http/http_cache_transaction.cc File net/http/http_cache_transaction.cc (right): http://codereview.chromium.org/8633001/diff/1/net/http/http_cache_transaction.cc#newcode374 net/http/http_cache_transaction.cc:374: !is_sparse_ && !range_requested_) So this is OK because ...
9 years, 1 month ago (2011-11-22 18:24:39 UTC) #2
rvargas (doing something else)
9 years, 1 month ago (2011-11-22 18:35:03 UTC) #3
Thanks.

http://codereview.chromium.org/8633001/diff/1/net/http/http_cache_transaction.cc
File net/http/http_cache_transaction.cc (right):

http://codereview.chromium.org/8633001/diff/1/net/http/http_cache_transaction...
net/http/http_cache_transaction.cc:374: !is_sparse_ && !range_requested_)
Yes we will. 22900 is an optimization, so in this case we just don't optimize it
and default to double-saving.

On the other hand, this is not the only measure to avoid caching a download (not
even the main one, from my point of view). Any user-initiated download should
have the right LoadFlag from the beginning.

Note that a more common case is when we are resuming an interrupted fetch
(truncated flag). If we are reading from the cache (and that should be the
common case), then there's no network transaction yet, so we don't do anything.
That's in fact the crash I looked at.

On 2011/11/22 18:24:39, gavinp wrote:
> So this is OK because downloads are never range_requested?
> 
> What happens if we get a resource cached sparsely for some use, then do a
> download: will we still tickle bug 22900?

Powered by Google App Engine
This is Rietveld 408576698