diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 22:53:53 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 22:53:53 +0000 |
commit | fbf50470c2003cbf2943fa749e55e9705041af62 (patch) | |
tree | 2fdb3abb74995fc15ea56000e3d8310cd374e2dd /net/http/http_cache_transaction.cc | |
parent | 638abaa23be28384b9541c7f715bb06d6e68af61 (diff) | |
download | chromium_src-fbf50470c2003cbf2943fa749e55e9705041af62.zip chromium_src-fbf50470c2003cbf2943fa749e55e9705041af62.tar.gz chromium_src-fbf50470c2003cbf2943fa749e55e9705041af62.tar.bz2 |
Http Cache: chain GetLoadState from transactions waiting for
access to an entry to the transaction that has exclusive
access to that entry.
This means that requests that are blocked on the single writer
lock of the http cache will report the load state of the
request that has the lock, and WAITING_FOR_CACHE is reserved
for requests that are actually waiting for the entry to be
created by the cache.
BUG=43582
TEST=net_unittests
Review URL: http://codereview.chromium.org/2892010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52557 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_cache_transaction.cc')
-rw-r--r-- | net/http/http_cache_transaction.cc | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc index 96a3622..f524c60 100644 --- a/net/http/http_cache_transaction.cc +++ b/net/http/http_cache_transaction.cc @@ -314,11 +314,14 @@ const HttpResponseInfo* HttpCache::Transaction::GetResponseInfo() const { } LoadState HttpCache::Transaction::GetLoadState() const { - if (network_trans_.get()) - return network_trans_->GetLoadState(); - if (entry_ || !request_) - return LOAD_STATE_IDLE; - return LOAD_STATE_WAITING_FOR_CACHE; + LoadState state = GetWriterLoadState(); + if (state != LOAD_STATE_WAITING_FOR_CACHE) + return state; + + if (cache_) + return cache_->GetLoadStateForPendingTransaction(this); + + return LOAD_STATE_IDLE; } uint64 HttpCache::Transaction::GetUploadProgress() const { @@ -366,6 +369,14 @@ bool HttpCache::Transaction::AddTruncatedFlag() { return true; } +LoadState HttpCache::Transaction::GetWriterLoadState() const { + if (network_trans_.get()) + return network_trans_->GetLoadState(); + if (entry_ || !request_) + return LOAD_STATE_IDLE; + return LOAD_STATE_WAITING_FOR_CACHE; +} + //----------------------------------------------------------------------------- void HttpCache::Transaction::DoCallback(int rv) { |