diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-23 00:13:15 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-23 00:13:15 +0000 |
commit | 11b6f268594c48f26260fdf7f63ad7b76d1b13be (patch) | |
tree | 80be40988174401858aa74038faec04db8d863aa /net | |
parent | 9d038e13c2d02f3db650986f62bc2a71e2bec812 (diff) | |
download | chromium_src-11b6f268594c48f26260fdf7f63ad7b76d1b13be.zip chromium_src-11b6f268594c48f26260fdf7f63ad7b76d1b13be.tar.gz chromium_src-11b6f268594c48f26260fdf7f63ad7b76d1b13be.tar.bz2 |
Revert 189935 "Http cache: Don't delete entries when there is a ..."
net timeouts?
> Http cache: Don't delete entries when there is a network error.
>
> BUG=176075
> TEST=net_unittests
> Review URL: https://codereview.chromium.org/12259039
TBR=rvargas@google.com
Review URL: https://codereview.chromium.org/12985003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189954 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/http/http_cache_transaction.cc | 2 | ||||
-rw-r--r-- | net/http/http_cache_unittest.cc | 36 |
2 files changed, 0 insertions, 38 deletions
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc index edb5456..c45a8a0 100644 --- a/net/http/http_cache_transaction.cc +++ b/net/http/http_cache_transaction.cc @@ -829,8 +829,6 @@ int HttpCache::Transaction::DoSendRequestComplete(int result) { const HttpResponseInfo* response = network_trans_->GetResponseInfo(); DCHECK(response); response_.cert_request_info = response->cert_request_info; - } else if (response_.was_cached) { - DoneWritingToEntry(true); } return result; } diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc index 2121af0..a97ba8a 100644 --- a/net/http/http_cache_unittest.cc +++ b/net/http/http_cache_unittest.cc @@ -2923,42 +2923,6 @@ TEST(HttpCache, SimpleDELETE_DontInvalidate_416) { RemoveMockTransaction(&transaction); } -// Tests that we don't invalidate entries after a failed network transaction. -TEST(HttpCache, SimpleGET_DontInvalidateOnFailure) { - MockHttpCache cache(net::HttpCache::DefaultBackend::InMemory(1024 * 1024)); - - MockTransaction transaction(kSimpleGET_Transaction); - transaction.url="http://www.not-found.com/"; - transaction.load_flags |= net::LOAD_VALIDATE_CACHE; - AddMockTransaction(&transaction); - - // Populate the cache. - RunTransactionTest(cache.http_cache(), transaction); - - EXPECT_EQ(1, cache.network_layer()->transaction_count()); - - RemoveMockTransaction(&transaction); - MockHttpRequest request(transaction); - - Context* c = new Context(); - int rv = cache.http_cache()->CreateTransaction(net::DEFAULT_PRIORITY, - &c->trans, NULL); - EXPECT_EQ(net::OK, rv); - rv = c->trans->Start(&request, c->callback.callback(), net::BoundNetLog()); - EXPECT_EQ(net::ERR_FAILED, c->callback.GetResult(rv)); - - EXPECT_EQ(2, cache.network_layer()->transaction_count()); - delete c; - - transaction.load_flags = net::LOAD_ONLY_FROM_CACHE; - AddMockTransaction(&transaction); - RunTransactionTest(cache.http_cache(), transaction); - - // Make sure the transaction didn't reach the network. - EXPECT_EQ(2, cache.network_layer()->transaction_count()); - RemoveMockTransaction(&transaction); -} - TEST(HttpCache, RangeGET_SkipsCache) { MockHttpCache cache; |