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

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

Issue 839143002: Roll Chrome into Mojo. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase Created 5 years, 11 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 | « net/http/http_server_properties_manager_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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 return static_cast<MockNetworkLayer*>(http_cache_.network_layer()); 182 return static_cast<MockNetworkLayer*>(http_cache_.network_layer());
183 } 183 }
184 MockDiskCache* disk_cache(); 184 MockDiskCache* disk_cache();
185 185
186 // Wrapper around http_cache()->CreateTransaction(net::DEFAULT_PRIORITY...) 186 // Wrapper around http_cache()->CreateTransaction(net::DEFAULT_PRIORITY...)
187 int CreateTransaction(scoped_ptr<net::HttpTransaction>* trans); 187 int CreateTransaction(scoped_ptr<net::HttpTransaction>* trans);
188 188
189 // Wrapper to bypass the cache lock for new transactions. 189 // Wrapper to bypass the cache lock for new transactions.
190 void BypassCacheLock(); 190 void BypassCacheLock();
191 191
192 // Wrapper to fail request conditionalization for new transactions.
193 void FailConditionalizations();
194
192 // Helper function for reading response info from the disk cache. 195 // Helper function for reading response info from the disk cache.
193 static bool ReadResponseInfo(disk_cache::Entry* disk_entry, 196 static bool ReadResponseInfo(disk_cache::Entry* disk_entry,
194 net::HttpResponseInfo* response_info, 197 net::HttpResponseInfo* response_info,
195 bool* response_truncated); 198 bool* response_truncated);
196 199
197 // Helper function for writing response info into the disk cache. 200 // Helper function for writing response info into the disk cache.
198 static bool WriteResponseInfo(disk_cache::Entry* disk_entry, 201 static bool WriteResponseInfo(disk_cache::Entry* disk_entry,
199 const net::HttpResponseInfo* response_info, 202 const net::HttpResponseInfo* response_info,
200 bool skip_transient_headers, 203 bool skip_transient_headers,
201 bool response_truncated); 204 bool response_truncated);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 private: 257 private:
255 int Result() { return fail_ ? net::ERR_FAILED : net::OK; } 258 int Result() { return fail_ ? net::ERR_FAILED : net::OK; }
256 259
257 scoped_ptr<disk_cache::Backend>* backend_; 260 scoped_ptr<disk_cache::Backend>* backend_;
258 net::CompletionCallback callback_; 261 net::CompletionCallback callback_;
259 bool block_; 262 bool block_;
260 bool fail_; 263 bool fail_;
261 }; 264 };
262 265
263 #endif // NET_HTTP_MOCK_HTTP_CACHE_H_ 266 #endif // NET_HTTP_MOCK_HTTP_CACHE_H_
OLDNEW
« no previous file with comments | « net/http/http_server_properties_manager_unittest.cc ('k') | net/http/mock_http_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698