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

Unified Diff: net/http/http_cache_transaction.cc

Issue 232003002: Ignore disk cache for concurrent byte range requests to a single resource, to prevent stalling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check for range requests rather than CouldBeSparse() Created 6 years, 8 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 | no next file » | 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 e2d46be45350eec82cb3ec0850f1e792f17e98f2..af21e2bbb9ad8d7e71e7ec2348cddea656af8e56 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -843,6 +843,23 @@ int HttpCache::Transaction::DoGetBackendComplete(int result) {
mode_ = NONE;
}
}
+
+ // If we're already writing to an active entry with this key and it is
+ // a range request, we want to switch to pass-through mode. This
+ // eliminates a long-running issue (crbug.com/31014) where two of the same
+ // video resource could not be played back simultaneously due to one locking
+ // the cache entry until the entire video was downloaded.
+ //
+ // This is not an ideal solution, as we are now ignoring the cache entirely
+ // for all range requests to a resource beyond the first. This is however a
+ // much more succinct solution than the alternatives, which would require
+ // somewhat significant changes to the http caching logic.
+ // TODO(rileya): Support simultaneous transactions on sparse cache entries,
+ // and remove this hack.
scherkus (not reviewing) 2014/04/10 18:26:06 if the plan is to close the original bug, then I'd
rileya (GONE FROM CHROMIUM) 2014/04/10 19:24:51 Sounds good, filed crbug.com/362215.
+ if (ActiveEntry* entry = cache_->FindActiveEntry(cache_key_)) {
+ if (partial_ && entry->writer && entry->writer->range_requested_)
+ mode_ = NONE;
+ }
}
// Use PUT and DELETE only to invalidate existing stored entries.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698