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; |
} |