OLD | NEW |
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 disk_cache::Entry** entry, | 120 disk_cache::Entry** entry, |
121 const CompletionCallback& callback) override; | 121 const CompletionCallback& callback) override; |
122 int DoomEntry(const std::string& key, | 122 int DoomEntry(const std::string& key, |
123 const CompletionCallback& callback) override; | 123 const CompletionCallback& callback) override; |
124 int DoomAllEntries(const CompletionCallback& callback) override; | 124 int DoomAllEntries(const CompletionCallback& callback) override; |
125 int DoomEntriesBetween(base::Time initial_time, | 125 int DoomEntriesBetween(base::Time initial_time, |
126 base::Time end_time, | 126 base::Time end_time, |
127 const CompletionCallback& callback) override; | 127 const CompletionCallback& callback) override; |
128 int DoomEntriesSince(base::Time initial_time, | 128 int DoomEntriesSince(base::Time initial_time, |
129 const CompletionCallback& callback) override; | 129 const CompletionCallback& callback) override; |
| 130 int CalculateSizeOfEntriesBetween( |
| 131 base::Time initial_time, |
| 132 base::Time end_time, |
| 133 const CompletionCallback& callback) override; |
130 scoped_ptr<Iterator> CreateIterator() override; | 134 scoped_ptr<Iterator> CreateIterator() override; |
131 void GetStats(base::StringPairs* stats) override; | 135 void GetStats(base::StringPairs* stats) override; |
132 void OnExternalCacheHit(const std::string& key) override; | 136 void OnExternalCacheHit(const std::string& key) override; |
133 | 137 |
134 // Returns number of times a cache entry was successfully opened. | 138 // Returns number of times a cache entry was successfully opened. |
135 int open_count() const { return open_count_; } | 139 int open_count() const { return open_count_; } |
136 | 140 |
137 // Returns number of times a cache entry was successfully created. | 141 // Returns number of times a cache entry was successfully created. |
138 int create_count() const { return create_count_; } | 142 int create_count() const { return create_count_; } |
139 | 143 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 267 |
264 scoped_ptr<disk_cache::Backend>* backend_; | 268 scoped_ptr<disk_cache::Backend>* backend_; |
265 CompletionCallback callback_; | 269 CompletionCallback callback_; |
266 bool block_; | 270 bool block_; |
267 bool fail_; | 271 bool fail_; |
268 }; | 272 }; |
269 | 273 |
270 } // namespace net | 274 } // namespace net |
271 | 275 |
272 #endif // NET_HTTP_MOCK_HTTP_CACHE_H_ | 276 #endif // NET_HTTP_MOCK_HTTP_CACHE_H_ |
OLD | NEW |