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

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

Issue 2591743002: Implement a method to get the total size of a cache entry (Closed)
Patch Set: rebase 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
« no previous file with comments | « net/disk_cache/simple/simple_entry_impl.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 19 matching lines...) Expand all
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
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_
OLDNEW
« no previous file with comments | « net/disk_cache/simple/simple_entry_impl.cc ('k') | net/http/mock_http_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698