summaryrefslogtreecommitdiffstats
path: root/net/disk_cache
diff options
context:
space:
mode:
Diffstat (limited to 'net/disk_cache')
-rw-r--r--net/disk_cache/file_posix.cc6
-rw-r--r--net/disk_cache/in_flight_backend_io.cc2
-rw-r--r--net/disk_cache/in_flight_io.cc4
3 files changed, 6 insertions, 6 deletions
diff --git a/net/disk_cache/file_posix.cc b/net/disk_cache/file_posix.cc
index bade848..a8d74ae 100644
--- a/net/disk_cache/file_posix.cc
+++ b/net/disk_cache/file_posix.cc
@@ -184,7 +184,7 @@ void InFlightIO::PostRead(disk_cache::File *file, void* buf, size_t buf_len,
size_t offset, disk_cache::FileIOCallback *callback) {
scoped_refptr<BackgroundIO> operation(
new BackgroundIO(file, buf, buf_len, offset, callback, this));
- io_list_.insert(operation.get());
+ io_list_.insert(operation);
file->AddRef(); // Balanced on InvokeCallback()
if (!callback_thread_)
@@ -200,7 +200,7 @@ void InFlightIO::PostWrite(disk_cache::File* file, const void* buf,
disk_cache::FileIOCallback* callback) {
scoped_refptr<BackgroundIO> operation(
new BackgroundIO(file, buf, buf_len, offset, callback, this));
- io_list_.insert(operation.get());
+ io_list_.insert(operation);
file->AddRef(); // Balanced on InvokeCallback()
if (!callback_thread_)
@@ -241,7 +241,7 @@ void InFlightIO::InvokeCallback(BackgroundIO* operation, bool cancel_task) {
// Release the references acquired in PostRead / PostWrite.
operation->file()->Release();
- io_list_.erase(operation);
+ io_list_.erase(make_scoped_refptr(operation));
callback->OnFileIOComplete(bytes);
}
diff --git a/net/disk_cache/in_flight_backend_io.cc b/net/disk_cache/in_flight_backend_io.cc
index 8fafa4d..c4caed3 100644
--- a/net/disk_cache/in_flight_backend_io.cc
+++ b/net/disk_cache/in_flight_backend_io.cc
@@ -513,7 +513,7 @@ void InFlightBackendIO::QueueOperationToList(BackendIO* operation,
if (list->empty())
return PostOperation(operation);
- list->push_back(operation);
+ list->push_back(make_scoped_refptr(operation));
}
} // namespace
diff --git a/net/disk_cache/in_flight_io.cc b/net/disk_cache/in_flight_io.cc
index 5c859af..ba24d61 100644
--- a/net/disk_cache/in_flight_io.cc
+++ b/net/disk_cache/in_flight_io.cc
@@ -74,14 +74,14 @@ void InFlightIO::InvokeCallback(BackgroundIO* operation, bool cancel_task) {
// Make sure that we remove the operation from the list before invoking the
// callback (so that a subsequent cancel does not invoke the callback again).
DCHECK(io_list_.find(operation) != io_list_.end());
- io_list_.erase(operation);
+ io_list_.erase(make_scoped_refptr(operation));
OnOperationComplete(operation, cancel_task);
}
// Runs on the primary thread.
void InFlightIO::OnOperationPosted(BackgroundIO* operation) {
DCHECK(callback_thread_->BelongsToCurrentThread());
- io_list_.insert(operation);
+ io_list_.insert(make_scoped_refptr(operation));
}
} // namespace disk_cache