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

Unified Diff: net/http/http_cache_transaction.cc

Issue 23710059: Release the cache entry on deferred redirect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable new tests on Chrome Frame Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/http/http_cache_transaction.cc
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index a69bcc0b4397632ecec8b46f39dcadf913873cc0..1057e20e0d28ba364299bd552681fdd49d91ee0e 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -449,10 +449,12 @@ bool HttpCache::Transaction::GetFullRequestHeaders(
void HttpCache::Transaction::DoneReading() {
if (cache_.get() && entry_) {
- DCHECK(reading_);
- DCHECK_NE(mode_, UPDATE);
rvargas (doing something else) 2013/09/17 19:53:25 Is this line failing? UPDATE means that the caller
davidben 2013/09/17 22:16:04 Hrm. Yeah, I'm not sure why I removed it... I thin
- if (mode_ & WRITE)
+ if (mode_ & WRITE) {
DoneWritingToEntry(true);
+ } else {
+ cache_->DoneReadingFromEntry(entry_, this);
+ entry_ = NULL;
+ }
}
}
@@ -1340,10 +1342,6 @@ int HttpCache::Transaction::DoTruncateCachedMetadataComplete(int result) {
}
}
- // If this response is a redirect, then we can stop writing now. (We don't
- // need to cache the response body of a redirect.)
- if (response_.headers->IsRedirect(NULL))
- DoneWritingToEntry(true);
rvargas (doing something else) 2013/09/17 19:53:25 Even though it is redundant in the sense that the
davidben 2013/09/17 22:16:04 My reasoning for removing it was that this way we
rvargas (doing something else) 2013/09/18 18:37:10 I see your point. On the other hand, having to rel
mmenke 2013/09/18 18:40:39 We don't have to have the caller do anything but r
rvargas (doing something else) 2013/09/18 19:09:12 Here we are doing two things: If we know this is a
davidben 2013/09/18 19:35:43 Well, it's a requirement to release the cache entr
mmenke 2013/09/18 19:38:31 The old contract is effectively, "After receiving
rvargas (doing something else) 2013/09/18 21:41:32 sure, but what the cache keeps or drops is not par
rvargas (doing something else) 2013/09/18 21:41:32 Sort of. The contract for releasing the entry is t
mmenke 2013/09/18 22:14:31 I think falsely claiming an HTTP redirect response
next_state_ = STATE_PARTIAL_HEADERS_RECEIVED;
return OK;
}

Powered by Google App Engine
This is Rietveld 408576698