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

Unified Diff: net/disk_cache/blockfile/block_files.cc

Issue 2723083004: Remove a scoped_refptr<>::swap overload (Closed)
Patch Set: fix Created 3 years, 10 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
Index: net/disk_cache/blockfile/block_files.cc
diff --git a/net/disk_cache/blockfile/block_files.cc b/net/disk_cache/blockfile/block_files.cc
index 10798dae2bfe97beed1ed812b60364b5565f1410..b2664801daf7fe00d4064804abcd43e0b27d9977 100644
--- a/net/disk_cache/blockfile/block_files.cc
+++ b/net/disk_cache/blockfile/block_files.cc
@@ -515,7 +515,8 @@ bool BlockFiles::OpenBlockFile(int index) {
ScopedFlush flush(file.get());
DCHECK(!block_files_[index]);
- file.swap(&block_files_[index]);
+ block_files_[index] = file.get();
+ file->AddRef();
return true;
}
« net/disk_cache/blockfile/backend_impl.cc ('K') | « net/disk_cache/blockfile/backend_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698