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

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

Issue 2626173003: Calculate the size of all cache entries between two points in time. (Closed)
Patch Set: fix unit_tests compilation Created 3 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
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 const CompletionCallback& callback) override; 124 const CompletionCallback& callback) override;
125 int DoomEntry(const std::string& key, 125 int DoomEntry(const std::string& key,
126 const CompletionCallback& callback) override; 126 const CompletionCallback& callback) override;
127 int DoomAllEntries(const CompletionCallback& callback) override; 127 int DoomAllEntries(const CompletionCallback& callback) override;
128 int DoomEntriesBetween(base::Time initial_time, 128 int DoomEntriesBetween(base::Time initial_time,
129 base::Time end_time, 129 base::Time end_time,
130 const CompletionCallback& callback) override; 130 const CompletionCallback& callback) override;
131 int DoomEntriesSince(base::Time initial_time, 131 int DoomEntriesSince(base::Time initial_time,
132 const CompletionCallback& callback) override; 132 const CompletionCallback& callback) override;
133 int CalculateSizeOfAllEntries(const CompletionCallback& callback) override; 133 int CalculateSizeOfAllEntries(const CompletionCallback& callback) override;
134 int CalculateSizeOfEntriesBetween(
135 base::Time initial_time,
136 base::Time end_time,
137 const CompletionCallback& callback) override;
134 std::unique_ptr<Iterator> CreateIterator() override; 138 std::unique_ptr<Iterator> CreateIterator() override;
135 void GetStats(base::StringPairs* stats) override; 139 void GetStats(base::StringPairs* stats) override;
136 void OnExternalCacheHit(const std::string& key) override; 140 void OnExternalCacheHit(const std::string& key) override;
137 141
138 // Returns number of times a cache entry was successfully opened. 142 // Returns number of times a cache entry was successfully opened.
139 int open_count() const { return open_count_; } 143 int open_count() const { return open_count_; }
140 144
141 // Returns number of times a cache entry was successfully created. 145 // Returns number of times a cache entry was successfully created.
142 int create_count() const { return create_count_; } 146 int create_count() const { return create_count_; }
143 147
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 272
269 std::unique_ptr<disk_cache::Backend>* backend_; 273 std::unique_ptr<disk_cache::Backend>* backend_;
270 CompletionCallback callback_; 274 CompletionCallback callback_;
271 bool block_; 275 bool block_;
272 bool fail_; 276 bool fail_;
273 }; 277 };
274 278
275 } // namespace net 279 } // namespace net
276 280
277 #endif // NET_HTTP_MOCK_HTTP_CACHE_H_ 281 #endif // NET_HTTP_MOCK_HTTP_CACHE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698