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

Unified Diff: net/http/http_cache_transaction.h

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.cc ('k') | net/http/http_cache_transaction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache_transaction.h
diff --git a/net/http/http_cache_transaction.h b/net/http/http_cache_transaction.h
index aeef83e9b9c595b09a709dd521dcc9f56f11d7a0..084b601f388598b99380f17bf804801e0ec21dc7 100644
--- a/net/http/http_cache_transaction.h
+++ b/net/http/http_cache_transaction.h
@@ -103,6 +103,11 @@ class HttpCache::Transaction : public HttpTransaction {
const BoundNetLog& net_log() const;
+ // Bypasses the cache lock whenever there is lock contention.
+ void BypassLockForTest() {
+ bypass_lock_for_test_ = true;
+ }
+
// HttpTransaction methods:
virtual int Start(const HttpRequestInfo* request_info,
const CompletionCallback& callback,
@@ -350,6 +355,9 @@ class HttpCache::Transaction : public HttpTransaction {
// transaction should be restarted.
int OnCacheReadError(int result, bool restart);
+ // Called when the cache lock timeout fires.
+ void OnAddToEntryTimeout(base::TimeTicks start_time);
+
// Deletes the current partial cache entry (sparse), and optionally removes
// the control object (partial_).
void DoomPartialEntry(bool delete_object);
@@ -412,6 +420,7 @@ class HttpCache::Transaction : public HttpTransaction {
bool done_reading_; // All available data was read.
bool vary_mismatch_; // The request doesn't match the stored vary data.
bool couldnt_conditionalize_request_;
+ bool bypass_lock_for_test_; // A test is exercising the cache lock.
scoped_refptr<IOBuffer> read_buf_;
int io_buf_len_;
int read_offset_;
« no previous file with comments | « net/http/http_cache.cc ('k') | net/http/http_cache_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698