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

Unified Diff: net/http/http_cache.h

Issue 2953983003: Adds cache lock timeout handling after finishing headers phase. (Closed)
Patch Set: Created 3 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 | « no previous file | net/http/http_cache.cc » ('j') | net/http/http_cache_transaction.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache.h
diff --git a/net/http/http_cache.h b/net/http/http_cache.h
index 91214c179f9fb27051873c40a331821b3198386e..50d457ca9b4f5659968efcc7574b0a73e5d30d33 100644
--- a/net/http/http_cache.h
+++ b/net/http/http_cache.h
@@ -195,6 +195,13 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory {
// and effectively bypass the cache lock whenever there is lock contention.
void SimulateCacheLockTimeout() { bypass_lock_for_test_ = true; }
+ // Causes all transactions created after this point to simulate lock timeout
+ // and effectively bypass the cache lock whenever there is lock contention
+ // after the transaction has completed its headers phase.
+ void SimulateCacheLockTimeoutAfterHeaders() {
Randy Smith (Not in Mondays) 2017/06/23 17:38:01 nit: Can this method have a ForTesting suffix? I
shivanisha 2017/06/23 19:16:08 Done for both this and the existing SimulateCacheL
+ bypass_lock_after_headers_for_test_ = true;
+ }
+
// Causes all transactions created after this point to generate a failure
// when attempting to conditionalize a network request.
void FailConditionalizationForTest() {
@@ -513,6 +520,7 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory {
std::unique_ptr<BackendFactory> backend_factory_;
bool building_backend_;
bool bypass_lock_for_test_;
+ bool bypass_lock_after_headers_for_test_;
bool fail_conditionalization_for_test_;
Mode mode_;
« no previous file with comments | « no previous file | net/http/http_cache.cc » ('j') | net/http/http_cache_transaction.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698