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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 void OpenEntryInternal(bool have_index, | 185 void OpenEntryInternal(bool have_index, |
186 const CompletionCallback& callback, | 186 const CompletionCallback& callback, |
187 Entry** out_entry); | 187 Entry** out_entry); |
188 | 188 |
189 void CreateEntryInternal(bool have_index, | 189 void CreateEntryInternal(bool have_index, |
190 const CompletionCallback& callback, | 190 const CompletionCallback& callback, |
191 Entry** out_entry); | 191 Entry** out_entry); |
192 | 192 |
193 void CloseInternal(); | 193 void CloseInternal(); |
194 | 194 |
195 void ReadDataInternal(int index, | 195 int ReadDataInternal(bool try_sync, |
196 int offset, | 196 int index, |
197 net::IOBuffer* buf, | 197 int offset, |
198 int buf_len, | 198 net::IOBuffer* buf, |
199 const CompletionCallback& callback); | 199 int buf_len, |
| 200 const CompletionCallback& callback); |
200 | 201 |
201 void WriteDataInternal(int index, | 202 void WriteDataInternal(int index, |
202 int offset, | 203 int offset, |
203 net::IOBuffer* buf, | 204 net::IOBuffer* buf, |
204 int buf_len, | 205 int buf_len, |
205 const CompletionCallback& callback, | 206 const CompletionCallback& callback, |
206 bool truncate); | 207 bool truncate); |
207 | 208 |
208 void ReadSparseDataInternal(int64_t sparse_offset, | 209 void ReadSparseDataInternal(int64_t sparse_offset, |
209 net::IOBuffer* buf, | 210 net::IOBuffer* buf, |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 // 1 on disk, to reduce the number of file descriptors and save disk space. | 386 // 1 on disk, to reduce the number of file descriptors and save disk space. |
386 // This strategy allows stream 1 to change size easily. Since stream 0 is only | 387 // This strategy allows stream 1 to change size easily. Since stream 0 is only |
387 // used to write HTTP headers, the memory consumption of keeping it in memory | 388 // used to write HTTP headers, the memory consumption of keeping it in memory |
388 // is acceptable. | 389 // is acceptable. |
389 scoped_refptr<net::GrowableIOBuffer> stream_0_data_; | 390 scoped_refptr<net::GrowableIOBuffer> stream_0_data_; |
390 }; | 391 }; |
391 | 392 |
392 } // namespace disk_cache | 393 } // namespace disk_cache |
393 | 394 |
394 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ | 395 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ |
OLD | NEW |