| Index: net/http/http_cache_transaction.cc
|
| diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
|
| index 648199063a7e0f032f885a0467296a01ece8b035..a0446f98930df0a3c71c24bd493dc303fc78a6bd 100644
|
| --- a/net/http/http_cache_transaction.cc
|
| +++ b/net/http/http_cache_transaction.cc
|
| @@ -1200,7 +1200,35 @@ int HttpCache::Transaction::DoAddToEntry() {
|
| net_log_.BeginEvent(NetLog::TYPE_HTTP_CACHE_ADD_TO_ENTRY);
|
| DCHECK(entry_lock_waiting_since_.is_null());
|
| entry_lock_waiting_since_ = TimeTicks::Now();
|
| - return cache_->AddTransactionToEntry(new_entry_, this);
|
| +
|
| + int result = cache_->AddTransactionToEntry(new_entry_, this);
|
| +
|
| + // If we're a range request and we're blocked by the reader/writer lock, then
|
| + // we'll 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 (crbug.com/362215).
|
| + if (partial_ && result == net::ERR_IO_PENDING && (new_entry_->writer ||
|
| + (mode() & Transaction::WRITE && !new_entry_->readers.empty()))) {
|
| + entry_lock_waiting_since_ = TimeTicks();
|
| + net_log_.EndEvent(NetLog::TYPE_HTTP_CACHE_ADD_TO_ENTRY);
|
| + mode_ = NONE;
|
| + partial_->RestoreHeaders(&custom_request_->extra_headers);
|
| + partial_.reset();
|
| + next_state_ = STATE_SEND_REQUEST;
|
| + cache_pending_ = false;
|
| + cache_->RemovePendingTransaction(this);
|
| + new_entry_ = NULL;
|
| + return OK;
|
| + }
|
| + return result;
|
| }
|
|
|
| int HttpCache::Transaction::DoAddToEntryComplete(int result) {
|
|
|