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 19 matching lines...) Expand all Loading... |
30 explicit MockDiskEntry(const std::string& key); | 30 explicit MockDiskEntry(const std::string& key); |
31 | 31 |
32 bool is_doomed() const { return doomed_; } | 32 bool is_doomed() const { return doomed_; } |
33 | 33 |
34 void Doom() override; | 34 void Doom() override; |
35 void Close() override; | 35 void Close() override; |
36 std::string GetKey() const override; | 36 std::string GetKey() const override; |
37 base::Time GetLastUsed() const override; | 37 base::Time GetLastUsed() const override; |
38 base::Time GetLastModified() const override; | 38 base::Time GetLastModified() const override; |
39 int32_t GetDataSize(int index) const override; | 39 int32_t GetDataSize(int index) const override; |
| 40 int64_t GetEntrySize() const override; |
40 int ReadData(int index, | 41 int ReadData(int index, |
41 int offset, | 42 int offset, |
42 IOBuffer* buf, | 43 IOBuffer* buf, |
43 int buf_len, | 44 int buf_len, |
44 const CompletionCallback& callback) override; | 45 const CompletionCallback& callback) override; |
45 int WriteData(int index, | 46 int WriteData(int index, |
46 int offset, | 47 int offset, |
47 IOBuffer* buf, | 48 IOBuffer* buf, |
48 int buf_len, | 49 int buf_len, |
49 const CompletionCallback& callback, | 50 const CompletionCallback& callback, |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 269 |
269 std::unique_ptr<disk_cache::Backend>* backend_; | 270 std::unique_ptr<disk_cache::Backend>* backend_; |
270 CompletionCallback callback_; | 271 CompletionCallback callback_; |
271 bool block_; | 272 bool block_; |
272 bool fail_; | 273 bool fail_; |
273 }; | 274 }; |
274 | 275 |
275 } // namespace net | 276 } // namespace net |
276 | 277 |
277 #endif // NET_HTTP_MOCK_HTTP_CACHE_H_ | 278 #endif // NET_HTTP_MOCK_HTTP_CACHE_H_ |
OLD | NEW |