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

Unified Diff: net/http/http_cache.cc

Issue 345643003: Http cache: Implement a timeout for the cache lock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add constant Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_cache.h ('k') | net/http/http_cache_transaction.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache.cc
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index 74ce8a37dd44db2265097adc9ad07bb5b8189fda..aa6fc228bc6c91b7cbf31c3fa67145683466695f 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -290,6 +290,7 @@ HttpCache::HttpCache(const net::HttpNetworkSession::Params& params,
: net_log_(params.net_log),
backend_factory_(backend_factory),
building_backend_(false),
+ bypass_lock_for_test_(false),
mode_(NORMAL),
network_layer_(new HttpNetworkLayer(new HttpNetworkSession(params))),
weak_factory_(this) {
@@ -304,6 +305,7 @@ HttpCache::HttpCache(HttpNetworkSession* session,
: net_log_(session->net_log()),
backend_factory_(backend_factory),
building_backend_(false),
+ bypass_lock_for_test_(false),
mode_(NORMAL),
network_layer_(new HttpNetworkLayer(session)),
weak_factory_(this) {
@@ -315,6 +317,7 @@ HttpCache::HttpCache(HttpTransactionFactory* network_layer,
: net_log_(net_log),
backend_factory_(backend_factory),
building_backend_(false),
+ bypass_lock_for_test_(false),
mode_(NORMAL),
network_layer_(network_layer),
weak_factory_(this) {
@@ -457,7 +460,12 @@ int HttpCache::CreateTransaction(RequestPriority priority,
CreateBackend(NULL, net::CompletionCallback());
}
- trans->reset(new HttpCache::Transaction(priority, this));
+ HttpCache::Transaction* transaction =
+ new HttpCache::Transaction(priority, this);
+ if (bypass_lock_for_test_)
+ transaction->BypassLockForTest();
+
+ trans->reset(transaction);
return OK;
}
« no previous file with comments | « net/http/http_cache.h ('k') | net/http/http_cache_transaction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698