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

Issue 181173003: Deactivate cache entry when caching is stopped.

Created:
6 years, 10 months ago by joleksy
Modified:
5 years, 10 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, gavinp+disk_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Deactivate cache entry when caching is stopped. The method HttpCache::Transaction::StopCaching is called when resource download begins. The method deactivates http caching mechanism for the downloaded resource (see mode_ = NONE;). However, the deactivation is not complete: the resource is still kept in http cache structures. This causes all requests to this resource (e.g. second download request) to fail, as the resource is still registered as active cache entry (and the request just waits for the cache element to become available, which will never happen because once download finishes, the cache entry is removed). This fix makes the cache entry inactive, thus making another request for this resource possible.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -2 lines) Patch
M net/http/http_cache_transaction.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M net/http/http_cache_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/http/mock_http_cache.h View 2 chunks +7 lines, -0 lines 0 comments Download
M net/http/mock_http_cache.cc View 2 chunks +26 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
joleksy
@reviewer: does this patch look OK to you?
6 years, 10 months ago (2014-02-26 09:24:47 UTC) #1
rvargas (doing something else)
Could you open a bug report? The problem with this patch is that it blindly ...
6 years, 10 months ago (2014-02-27 03:37:41 UTC) #2
joleksy
On 2014/02/27 03:37:41, rvargas wrote: > Could you open a bug report? > > The ...
6 years, 10 months ago (2014-02-27 08:05:56 UTC) #3
joleksy
On 2014/02/27 08:05:56, joleksy wrote: > On 2014/02/27 03:37:41, rvargas wrote: > > Could you ...
5 years, 10 months ago (2015-02-23 08:16:49 UTC) #4
rvargas (doing something else)
On 2015/02/23 08:16:49, joleksy wrote: > On 2014/02/27 08:05:56, joleksy wrote: > > On 2014/02/27 ...
5 years, 10 months ago (2015-02-24 02:02:58 UTC) #5
joleksy
5 years, 10 months ago (2015-02-24 07:55:13 UTC) #6
On 2015/02/24 02:02:58, rvargas wrote:
> On 2015/02/23 08:16:49, joleksy wrote:
> > On 2014/02/27 08:05:56, joleksy wrote:
> > > On 2014/02/27 03:37:41, rvargas wrote:
> > > > Could you open a bug report?
> > > > 
> > > > The problem with this patch is that it blindly deletes the entry from
the
> > > cache.
> > > > For instance, the cache may already hold the whole resource, then a
> download
> > > > starts and the download manager decides to stop caching... that should
not
> > > > delete the entry.
> > > > 
> > > > I'm not really happy with not having restrictions on the use of this
> method
> > > > (StopCaching), which prevents us from doing the right thing right away
(as
> > the
> > > > comment states)... which would be calling DoneWithEntry().
> > > 
> > > Bug report opened:
> > > 
> > > https://code.google.com/p/chromium/issues/detail?id=347458
> > 
> > Any input on this one? Should it be fixed in some different way?
> 
> In the big picture, deleting an entry when we could keep it is not that big of
a
> deal (unless we go into a mode where we do that all the time, which I'm afraid
> could happen).
> 
> There is no resolution on the bug report, but I would prefer to implement
option
> 1 of comment #8... it is more work, but I think it's cleaner than what we have
> today :(.
> 
> Makes sense?

OK, thanks. I will try to implement the suggested solution.

Powered by Google App Engine
This is Rietveld 408576698