| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ | 5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ |
| 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ | 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 uint64 entry_hash() const { return entry_hash_; } | 79 uint64 entry_hash() const { return entry_hash_; } |
| 80 void SetKey(const std::string& key); | 80 void SetKey(const std::string& key); |
| 81 | 81 |
| 82 // From Entry: | 82 // From Entry: |
| 83 void Doom() override; | 83 void Doom() override; |
| 84 void Close() override; | 84 void Close() override; |
| 85 std::string GetKey() const override; | 85 std::string GetKey() const override; |
| 86 base::Time GetLastUsed() const override; | 86 base::Time GetLastUsed() const override; |
| 87 base::Time GetLastModified() const override; | 87 base::Time GetLastModified() const override; |
| 88 int32 GetDataSize(int index) const override; | 88 int32 GetDataSize(int index) const override; |
| 89 int GetEntrySize() const override; |
| 89 int ReadData(int stream_index, | 90 int ReadData(int stream_index, |
| 90 int offset, | 91 int offset, |
| 91 net::IOBuffer* buf, | 92 net::IOBuffer* buf, |
| 92 int buf_len, | 93 int buf_len, |
| 93 const CompletionCallback& callback) override; | 94 const CompletionCallback& callback) override; |
| 94 int WriteData(int stream_index, | 95 int WriteData(int stream_index, |
| 95 int offset, | 96 int offset, |
| 96 net::IOBuffer* buf, | 97 net::IOBuffer* buf, |
| 97 int buf_len, | 98 int buf_len, |
| 98 const CompletionCallback& callback, | 99 const CompletionCallback& callback, |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 // 1 on disk, to reduce the number of file descriptors and save disk space. | 375 // 1 on disk, to reduce the number of file descriptors and save disk space. |
| 375 // This strategy allows stream 1 to change size easily. Since stream 0 is only | 376 // This strategy allows stream 1 to change size easily. Since stream 0 is only |
| 376 // used to write HTTP headers, the memory consumption of keeping it in memory | 377 // used to write HTTP headers, the memory consumption of keeping it in memory |
| 377 // is acceptable. | 378 // is acceptable. |
| 378 scoped_refptr<net::GrowableIOBuffer> stream_0_data_; | 379 scoped_refptr<net::GrowableIOBuffer> stream_0_data_; |
| 379 }; | 380 }; |
| 380 | 381 |
| 381 } // namespace disk_cache | 382 } // namespace disk_cache |
| 382 | 383 |
| 383 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ | 384 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ |
| OLD | NEW |