| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 246 |
| 247 // Called after an asynchronous read. Updates |crc32s_| if possible. | 247 // Called after an asynchronous read. Updates |crc32s_| if possible. |
| 248 void ReadOperationComplete(int stream_index, | 248 void ReadOperationComplete(int stream_index, |
| 249 int offset, | 249 int offset, |
| 250 const CompletionCallback& completion_callback, | 250 const CompletionCallback& completion_callback, |
| 251 std::unique_ptr<uint32_t> read_crc32, | 251 std::unique_ptr<uint32_t> read_crc32, |
| 252 std::unique_ptr<SimpleEntryStat> entry_stat, | 252 std::unique_ptr<SimpleEntryStat> entry_stat, |
| 253 std::unique_ptr<int> result); | 253 std::unique_ptr<int> result); |
| 254 | 254 |
| 255 // Called after an asynchronous write completes. | 255 // Called after an asynchronous write completes. |
| 256 // |buf| parameter brings back a reference to net::IOBuffer to the original | |
| 257 // thread, so that we can reduce cross thread malloc/free pair. | |
| 258 // See http://crbug.com/708644 for details. | |
| 259 void WriteOperationComplete(int stream_index, | 256 void WriteOperationComplete(int stream_index, |
| 260 const CompletionCallback& completion_callback, | 257 const CompletionCallback& completion_callback, |
| 261 std::unique_ptr<SimpleEntryStat> entry_stat, | 258 std::unique_ptr<SimpleEntryStat> entry_stat, |
| 262 std::unique_ptr<int> result, | 259 std::unique_ptr<int> result); |
| 263 net::IOBuffer* buf); | |
| 264 | 260 |
| 265 void ReadSparseOperationComplete( | 261 void ReadSparseOperationComplete( |
| 266 const CompletionCallback& completion_callback, | 262 const CompletionCallback& completion_callback, |
| 267 std::unique_ptr<base::Time> last_used, | 263 std::unique_ptr<base::Time> last_used, |
| 268 std::unique_ptr<int> result); | 264 std::unique_ptr<int> result); |
| 269 | 265 |
| 270 void WriteSparseOperationComplete( | 266 void WriteSparseOperationComplete( |
| 271 const CompletionCallback& completion_callback, | 267 const CompletionCallback& completion_callback, |
| 272 std::unique_ptr<SimpleEntryStat> entry_stat, | 268 std::unique_ptr<SimpleEntryStat> entry_stat, |
| 273 std::unique_ptr<int> result); | 269 std::unique_ptr<int> result); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 // 1 on disk, to reduce the number of file descriptors and save disk space. | 385 // 1 on disk, to reduce the number of file descriptors and save disk space. |
| 390 // This strategy allows stream 1 to change size easily. Since stream 0 is only | 386 // This strategy allows stream 1 to change size easily. Since stream 0 is only |
| 391 // used to write HTTP headers, the memory consumption of keeping it in memory | 387 // used to write HTTP headers, the memory consumption of keeping it in memory |
| 392 // is acceptable. | 388 // is acceptable. |
| 393 scoped_refptr<net::GrowableIOBuffer> stream_0_data_; | 389 scoped_refptr<net::GrowableIOBuffer> stream_0_data_; |
| 394 }; | 390 }; |
| 395 | 391 |
| 396 } // namespace disk_cache | 392 } // namespace disk_cache |
| 397 | 393 |
| 398 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ | 394 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ |
| OLD | NEW |