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

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

Issue 1815363002: Add RetainedRef uses where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/cert/nss_cert_database.cc ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | 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 c7dc073a5703c12e2185a7b6c4380802a96296b3..643b13c47e68662ca254322d532fb6d75a776670 100644
--- a/net/disk_cache/simple/simple_entry_impl.cc
+++ b/net/disk_cache/simple/simple_entry_impl.cc
@@ -789,13 +789,11 @@ void SimpleEntryImpl::CloseInternal() {
}
if (synchronous_entry_) {
- Closure task =
- base::Bind(&SimpleSynchronousEntry::Close,
- base::Unretained(synchronous_entry_),
- SimpleEntryStat(last_used_, last_modified_, data_size_,
- sparse_data_size_),
- base::Passed(&crc32s_to_write),
- stream_0_data_);
+ Closure task = base::Bind(
+ &SimpleSynchronousEntry::Close, base::Unretained(synchronous_entry_),
+ SimpleEntryStat(last_used_, last_modified_, data_size_,
+ sparse_data_size_),
+ base::Passed(&crc32s_to_write), base::RetainedRef(stream_0_data_));
Closure reply = base::Bind(&SimpleEntryImpl::CloseOperationComplete, this);
synchronous_entry_ = NULL;
worker_pool_->PostTaskAndReply(FROM_HERE, task, reply);
@@ -876,13 +874,9 @@ void SimpleEntryImpl::ReadDataInternal(int stream_index,
new SimpleEntryStat(last_used_, last_modified_, data_size_,
sparse_data_size_));
Closure task = base::Bind(
- &SimpleSynchronousEntry::ReadData,
- base::Unretained(synchronous_entry_),
+ &SimpleSynchronousEntry::ReadData, base::Unretained(synchronous_entry_),
SimpleSynchronousEntry::EntryOperationData(stream_index, offset, buf_len),
- make_scoped_refptr(buf),
- read_crc32.get(),
- entry_stat.get(),
- result.get());
+ base::RetainedRef(buf), read_crc32.get(), entry_stat.get(), result.get());
Closure reply = base::Bind(&SimpleEntryImpl::ReadOperationComplete,
this,
stream_index,
@@ -977,14 +971,11 @@ void SimpleEntryImpl::WriteDataInternal(int stream_index,
have_written_[0] = true;
scoped_ptr<int> result(new int());
- Closure task = base::Bind(&SimpleSynchronousEntry::WriteData,
- base::Unretained(synchronous_entry_),
- SimpleSynchronousEntry::EntryOperationData(
- stream_index, offset, buf_len, truncate,
- doomed_),
- make_scoped_refptr(buf),
- entry_stat.get(),
- result.get());
+ Closure task = base::Bind(
+ &SimpleSynchronousEntry::WriteData, base::Unretained(synchronous_entry_),
+ SimpleSynchronousEntry::EntryOperationData(stream_index, offset, buf_len,
+ truncate, doomed_),
+ base::RetainedRef(buf), entry_stat.get(), result.get());
Closure reply = base::Bind(&SimpleEntryImpl::WriteOperationComplete,
this,
stream_index,
@@ -1013,13 +1004,11 @@ void SimpleEntryImpl::ReadSparseDataInternal(
scoped_ptr<int> result(new int());
scoped_ptr<base::Time> last_used(new base::Time());
- Closure task = base::Bind(&SimpleSynchronousEntry::ReadSparseData,
- base::Unretained(synchronous_entry_),
- SimpleSynchronousEntry::EntryOperationData(
- sparse_offset, buf_len),
- make_scoped_refptr(buf),
- last_used.get(),
- result.get());
+ Closure task = base::Bind(
+ &SimpleSynchronousEntry::ReadSparseData,
+ base::Unretained(synchronous_entry_),
+ SimpleSynchronousEntry::EntryOperationData(sparse_offset, buf_len),
+ base::RetainedRef(buf), last_used.get(), result.get());
Closure reply = base::Bind(&SimpleEntryImpl::ReadSparseOperationComplete,
this,
callback,
@@ -1058,14 +1047,12 @@ void SimpleEntryImpl::WriteSparseDataInternal(
last_used_ = last_modified_ = base::Time::Now();
scoped_ptr<int> result(new int());
- Closure task = base::Bind(&SimpleSynchronousEntry::WriteSparseData,
- base::Unretained(synchronous_entry_),
- SimpleSynchronousEntry::EntryOperationData(
- sparse_offset, buf_len),
- make_scoped_refptr(buf),
- max_sparse_data_size,
- entry_stat.get(),
- result.get());
+ Closure task = base::Bind(
+ &SimpleSynchronousEntry::WriteSparseData,
+ base::Unretained(synchronous_entry_),
+ SimpleSynchronousEntry::EntryOperationData(sparse_offset, buf_len),
+ base::RetainedRef(buf), max_sparse_data_size, entry_stat.get(),
+ result.get());
Closure reply = base::Bind(&SimpleEntryImpl::WriteSparseOperationComplete,
this,
callback,
« no previous file with comments | « net/cert/nss_cert_database.cc ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698