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

Unified Diff: net/disk_cache/simple/simple_entry_impl.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/simple/simple_entry_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_entry_impl.cc
diff --git a/net/disk_cache/simple/simple_entry_impl.cc b/net/disk_cache/simple/simple_entry_impl.cc
index b60d7a405ac171a923efbc43aa50596a229e9011..40ea198a7a8e7b32177d54969d9f40e14e3e1db4 100644
--- a/net/disk_cache/simple/simple_entry_impl.cc
+++ b/net/disk_cache/simple/simple_entry_impl.cc
@@ -973,18 +973,17 @@
have_written_[0] = true;
std::unique_ptr<int> result(new int());
-
- // Retain a reference to |buf| in |reply| instead of |task|, so that we can
- // reduce cross thread malloc/free pairs. The cross thread malloc/free pair
- // increases the apparent memory usage due to the thread cached free list.
Closure task = base::Bind(
&SimpleSynchronousEntry::WriteData, base::Unretained(synchronous_entry_),
SimpleSynchronousEntry::EntryOperationData(stream_index, offset, buf_len,
truncate, doomed_),
- base::Unretained(buf), entry_stat.get(), result.get());
- Closure reply = base::Bind(&SimpleEntryImpl::WriteOperationComplete, this,
- stream_index, callback, base::Passed(&entry_stat),
- base::Passed(&result), base::RetainedRef(buf));
+ base::RetainedRef(buf), entry_stat.get(), result.get());
+ Closure reply = base::Bind(&SimpleEntryImpl::WriteOperationComplete,
+ this,
+ stream_index,
+ callback,
+ base::Passed(&entry_stat),
+ base::Passed(&result));
worker_pool_->PostTaskAndReply(FROM_HERE, task, reply);
}
@@ -1272,8 +1271,7 @@
int stream_index,
const CompletionCallback& completion_callback,
std::unique_ptr<SimpleEntryStat> entry_stat,
- std::unique_ptr<int> result,
- net::IOBuffer* buf) {
+ std::unique_ptr<int> result) {
if (*result >= 0)
RecordWriteResult(cache_type_, WRITE_RESULT_SUCCESS);
else
« no previous file with comments | « net/disk_cache/simple/simple_entry_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698