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

Side by Side Diff: net/disk_cache/simple/simple_entry_impl.h

Issue 2814743011: Revert of Avoid cross thread malloc / free pair of IOBuffer on the simple cache (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | net/disk_cache/simple/simple_entry_impl.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) 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
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
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_
OLDNEW
« no previous file with comments | « no previous file | net/disk_cache/simple/simple_entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698