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

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

Issue 1476123002: Bounce all requests off the cache lock after 25ms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mmenke comments Created 5 years 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 | « net/http/http_cache_unittest.cc ('k') | net/http/mock_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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 is a mock of the http cache and related testing classes. To be fair, it 5 // This is a mock of the http cache and related testing classes. To be fair, it
6 // is not really a mock http cache given that it uses the real implementation of 6 // is not really a mock http cache given that it uses the real implementation of
7 // the http cache, but it has fake implementations of all required components, 7 // the http cache, but it has fake implementations of all required components,
8 // so it is useful for unit tests at the http layer. 8 // so it is useful for unit tests at the http layer.
9 9
10 #ifndef NET_HTTP_MOCK_HTTP_CACHE_H_ 10 #ifndef NET_HTTP_MOCK_HTTP_CACHE_H_
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 MockNetworkLayer* network_layer() { 185 MockNetworkLayer* network_layer() {
186 return static_cast<MockNetworkLayer*>(http_cache_.network_layer()); 186 return static_cast<MockNetworkLayer*>(http_cache_.network_layer());
187 } 187 }
188 disk_cache::Backend* backend(); 188 disk_cache::Backend* backend();
189 MockDiskCache* disk_cache(); 189 MockDiskCache* disk_cache();
190 190
191 // Wrapper around http_cache()->CreateTransaction(DEFAULT_PRIORITY...) 191 // Wrapper around http_cache()->CreateTransaction(DEFAULT_PRIORITY...)
192 int CreateTransaction(scoped_ptr<HttpTransaction>* trans); 192 int CreateTransaction(scoped_ptr<HttpTransaction>* trans);
193 193
194 // Wrapper to bypass the cache lock for new transactions.
195 void BypassCacheLock();
196
197 // Wrapper to fail request conditionalization for new transactions. 194 // Wrapper to fail request conditionalization for new transactions.
198 void FailConditionalizations(); 195 void FailConditionalizations();
199 196
200 // Helper function for reading response info from the disk cache. 197 // Helper function for reading response info from the disk cache.
201 static bool ReadResponseInfo(disk_cache::Entry* disk_entry, 198 static bool ReadResponseInfo(disk_cache::Entry* disk_entry,
202 HttpResponseInfo* response_info, 199 HttpResponseInfo* response_info,
203 bool* response_truncated); 200 bool* response_truncated);
204 201
205 // Helper function for writing response info into the disk cache. 202 // Helper function for writing response info into the disk cache.
206 static bool WriteResponseInfo(disk_cache::Entry* disk_entry, 203 static bool WriteResponseInfo(disk_cache::Entry* disk_entry,
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 262
266 scoped_ptr<disk_cache::Backend>* backend_; 263 scoped_ptr<disk_cache::Backend>* backend_;
267 CompletionCallback callback_; 264 CompletionCallback callback_;
268 bool block_; 265 bool block_;
269 bool fail_; 266 bool fail_;
270 }; 267 };
271 268
272 } // namespace net 269 } // namespace net
273 270
274 #endif // NET_HTTP_MOCK_HTTP_CACHE_H_ 271 #endif // NET_HTTP_MOCK_HTTP_CACHE_H_
OLDNEW
« no previous file with comments | « net/http/http_cache_unittest.cc ('k') | net/http/mock_http_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698