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

Side by Side Diff: net/http/http_cache.h

Issue 2671793002: Correct handling of ERR_CACHE_LOCK_TIMEOUT for read only transactions. (Closed)
Patch Set: Feedback addressed. Created 3 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
« no previous file with comments | « no previous file | net/http/http_cache.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file declares a HttpTransactionFactory implementation that can be 5 // This file declares a HttpTransactionFactory implementation that can be
6 // layered on top of another HttpTransactionFactory to add HTTP caching. The 6 // layered on top of another HttpTransactionFactory to add HTTP caching. The
7 // caching logic follows RFC 7234 (any exceptions are called out in the code). 7 // caching logic follows RFC 7234 (any exceptions are called out in the code).
8 // 8 //
9 // The HttpCache takes a disk_cache::Backend as a parameter, and uses that for 9 // The HttpCache takes a disk_cache::Backend as a parameter, and uses that for
10 // the cache storage. 10 // the cache storage.
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 // immediately, but they will not be reusable. This is for debugging. 181 // immediately, but they will not be reusable. This is for debugging.
182 void CloseAllConnections(); 182 void CloseAllConnections();
183 183
184 // Close all idle connections. Will close all sockets not in active use. 184 // Close all idle connections. Will close all sockets not in active use.
185 void CloseIdleConnections(); 185 void CloseIdleConnections();
186 186
187 // Called whenever an external cache in the system reuses the resource 187 // Called whenever an external cache in the system reuses the resource
188 // referred to by |url| and |http_method|. 188 // referred to by |url| and |http_method|.
189 void OnExternalCacheHit(const GURL& url, const std::string& http_method); 189 void OnExternalCacheHit(const GURL& url, const std::string& http_method);
190 190
191 // Causes all transactions created after this point to effectively bypass 191 // Causes all transactions created after this point to simulate lock timeout
192 // the cache lock whenever there is lock contention. 192 // and effectively bypass the cache lock whenever there is lock contention.
193 void BypassLockForTest() { 193 void SimulateCacheLockTimeout() { bypass_lock_for_test_ = true; }
194 bypass_lock_for_test_ = true;
195 }
196 194
197 // Causes all transactions created after this point to generate a failure 195 // Causes all transactions created after this point to generate a failure
198 // when attempting to conditionalize a network request. 196 // when attempting to conditionalize a network request.
199 void FailConditionalizationForTest() { 197 void FailConditionalizationForTest() {
200 fail_conditionalization_for_test_ = true; 198 fail_conditionalization_for_test_ = true;
201 } 199 }
202 200
203 // HttpTransactionFactory implementation: 201 // HttpTransactionFactory implementation:
204 int CreateTransaction(RequestPriority priority, 202 int CreateTransaction(RequestPriority priority,
205 std::unique_ptr<HttpTransaction>* trans) override; 203 std::unique_ptr<HttpTransaction>* trans) override;
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 std::unique_ptr<base::Clock> clock_; 421 std::unique_ptr<base::Clock> clock_;
424 422
425 base::WeakPtrFactory<HttpCache> weak_factory_; 423 base::WeakPtrFactory<HttpCache> weak_factory_;
426 424
427 DISALLOW_COPY_AND_ASSIGN(HttpCache); 425 DISALLOW_COPY_AND_ASSIGN(HttpCache);
428 }; 426 };
429 427
430 } // namespace net 428 } // namespace net
431 429
432 #endif // NET_HTTP_HTTP_CACHE_H_ 430 #endif // NET_HTTP_HTTP_CACHE_H_
OLDNEW
« no previous file with comments | « no previous file | net/http/http_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698