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

Side by Side Diff: net/http/http_cache_unittest.cc

Issue 21369: Use RevocableStore to isolate the http cache from its transactions.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/http/http_cache.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_cache.h" 5 #include "net/http/http_cache.h"
6 6
7 #include "base/hash_tables.h" 7 #include "base/hash_tables.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 1081
1082 scoped_ptr<net::HttpTransaction> trans( 1082 scoped_ptr<net::HttpTransaction> trans(
1083 cache.http_cache()->CreateTransaction()); 1083 cache.http_cache()->CreateTransaction());
1084 ASSERT_TRUE(trans.get()); 1084 ASSERT_TRUE(trans.get());
1085 1085
1086 int rv = trans->Start(&request, &callback); 1086 int rv = trans->Start(&request, &callback);
1087 if (rv == net::ERR_IO_PENDING) 1087 if (rv == net::ERR_IO_PENDING)
1088 rv = callback.WaitForResult(); 1088 rv = callback.WaitForResult();
1089 ASSERT_EQ(net::ERR_CACHE_MISS, rv); 1089 ASSERT_EQ(net::ERR_CACHE_MISS, rv);
1090 } 1090 }
1091
1092 // Ensure that we don't crash by if left-behind transactions.
1093 TEST(HttpCache, OutlivedTransactions) {
1094 MockHttpCache* cache = new MockHttpCache;
1095
1096 net::HttpTransaction* trans = cache->http_cache()->CreateTransaction();
1097 delete cache;
1098 delete trans;
1099 }
OLDNEW
« no previous file with comments | « net/http/http_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698