From 00cd9c4e71d1e6dd6cc3a2fff60505479304c9d1 Mon Sep 17 00:00:00 2001 From: "thakis@chromium.org" Date: Tue, 2 Nov 2010 20:15:57 +0000 Subject: Convert implicit scoped_refptr constructor calls to explicit ones, part 2 This CL was created automatically by this clang rewriter: http://codereview.appspot.com/2826041 I then did quite a bit of manual editing to fix style issues. BUG=28083 TEST=None Review URL: http://codereview.chromium.org/4291001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64798 0039d316-1c4b-4281-b951-d872f2087c98 --- net/disk_cache/file_posix.cc | 6 +++--- net/disk_cache/in_flight_backend_io.cc | 2 +- net/disk_cache/in_flight_io.cc | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'net/disk_cache') 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 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 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 -- cgit v1.1