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

Unified Diff: net/http/http_cache_transaction.cc

Issue 509783002: Http cache: Allow caching of byte ranges without strong validators. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments Created 6 years, 4 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 | « no previous file | 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 f11d695579aea88b7090f45d65a7483b2c23b1be..c49f73d33b6390967a3fc29ee8348e014eae6de7 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -1559,15 +1559,6 @@ int HttpCache::Transaction::DoOverwriteCachedResponse() {
return OK;
}
- if (handling_206_ && !CanResume(false)) {
- // There is no point in storing this resource because it will never be used.
- DoneWritingToEntry(false);
- if (partial_.get())
- partial_->FixResponseHeaders(response_.headers.get(), true);
- next_state_ = STATE_PARTIAL_HEADERS_RECEIVED;
- return OK;
- }
-
target_state_ = STATE_TRUNCATE_CACHED_DATA;
next_state_ = truncated_ ? STATE_CACHE_WRITE_TRUNCATED_RESPONSE :
STATE_CACHE_WRITE_RESPONSE;
@@ -2307,9 +2298,10 @@ bool HttpCache::Transaction::ConditionalizeRequest() {
return false;
}
- // We should have handled this case before.
- DCHECK(response_.headers->response_code() != 206 ||
- response_.headers->HasStrongValidators());
+ if (response_.headers->response_code() == 206 &&
+ !response_.headers->HasStrongValidators()) {
+ return false;
+ }
// Just use the first available ETag and/or Last-Modified header value.
// TODO(darin): Or should we use the last?
« no previous file with comments | « no previous file | net/http/http_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698