summaryrefslogtreecommitdiffstats
path: root/net/http/http_cache_transaction.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-22 18:36:15 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-22 18:36:15 +0000
commit49abb41f22d656b3a974d84fd425e437f74a706a (patch)
tree52f81fe5ae67126154de23e0f646477b27a1cdd7 /net/http/http_cache_transaction.cc
parent0f7daaa7f3dcb7cf29d19feff1d9004edae4b747 (diff)
downloadchromium_src-49abb41f22d656b3a974d84fd425e437f74a706a.zip
chromium_src-49abb41f22d656b3a974d84fd425e437f74a706a.tar.gz
chromium_src-49abb41f22d656b3a974d84fd425e437f74a706a.tar.bz2
Http Cache: Make sure that we don't switch to mode NONE when
StopCaching is called if there is no network transaction, or the entry is sparse. BUG=105041, 22900 TEST=net_unittests Review URL: http://codereview.chromium.org/8633001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_cache_transaction.cc')
-rw-r--r--net/http/http_cache_transaction.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 6e46c36..a17e890 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -370,7 +370,8 @@ void HttpCache::Transaction::StopCaching() {
// entry how it is (it will be marked as truncated at destruction), and let
// the next piece of code that executes know that we are now reading directly
// from the net.
- if (cache_ && entry_ && (mode_ & WRITE))
+ if (cache_ && entry_ && (mode_ & WRITE) && network_trans_.get() &&
+ !is_sparse_ && !range_requested_)
mode_ = NONE;
}