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

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: 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
« no previous file with comments | « net/http/http_cache.cc ('k') | net/http/http_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f4de0729f28b83f8169eee63b70a594c6f613b7a 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -449,10 +449,13 @@ bool HttpCache::Transaction::GetFullRequestHeaders(
void HttpCache::Transaction::DoneReading() {
if (cache_.get() && entry_) {
- DCHECK(reading_);
DCHECK_NE(mode_, UPDATE);
- if (mode_ & WRITE)
+ if (mode_ & WRITE) {
DoneWritingToEntry(true);
+ } else {
+ cache_->DoneReadingFromEntry(entry_, this);
+ entry_ = NULL;
+ }
}
}
@@ -1340,10 +1343,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);
next_state_ = STATE_PARTIAL_HEADERS_RECEIVED;
return OK;
}
« no previous file with comments | « net/http/http_cache.cc ('k') | net/http/http_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698