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

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

Issue 2815563002: 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 std::unique_ptr<int> result); 245 std::unique_ptr<int> result);
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.
jkarlin 2017/04/11 11:24:39 Can you add a comment about why |buf| exists?
tzik 2017/04/13 07:11:17 Done.
256 void WriteOperationComplete(int stream_index, 256 void WriteOperationComplete(int stream_index,
257 const CompletionCallback& completion_callback, 257 const CompletionCallback& completion_callback,
258 std::unique_ptr<SimpleEntryStat> entry_stat, 258 std::unique_ptr<SimpleEntryStat> entry_stat,
259 std::unique_ptr<int> result); 259 std::unique_ptr<int> result,
260 net::IOBuffer* buf);
260 261
261 void ReadSparseOperationComplete( 262 void ReadSparseOperationComplete(
262 const CompletionCallback& completion_callback, 263 const CompletionCallback& completion_callback,
263 std::unique_ptr<base::Time> last_used, 264 std::unique_ptr<base::Time> last_used,
264 std::unique_ptr<int> result); 265 std::unique_ptr<int> result);
265 266
266 void WriteSparseOperationComplete( 267 void WriteSparseOperationComplete(
267 const CompletionCallback& completion_callback, 268 const CompletionCallback& completion_callback,
268 std::unique_ptr<SimpleEntryStat> entry_stat, 269 std::unique_ptr<SimpleEntryStat> entry_stat,
269 std::unique_ptr<int> result); 270 std::unique_ptr<int> result);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_
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