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

Unified Diff: net/disk_cache/backend_impl.cc

Issue 15956004: Disk cache: Avoid writing uninitialized data to disk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 7 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 | « no previous file | net/disk_cache/stats.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/backend_impl.cc
===================================================================
--- net/disk_cache/backend_impl.cc (revision 201943)
+++ net/disk_cache/backend_impl.cc (working copy)
@@ -1394,8 +1394,8 @@
int size = stats_.StorageSize();
scoped_ptr<char[]> data(new char[size]);
Addr address;
- bool rv = stats_.SerializeStats(data.get(), size, &address);
- DCHECK(rv);
+ size = stats_.SerializeStats(data.get(), size, &address);
+ DCHECK(size);
if (!address.is_initialized())
return;
@@ -1405,7 +1405,7 @@
size_t offset = address.start_block() * address.BlockSize() +
kBlockHeaderSize;
- rv = file->Write(data.get(), size, offset); // ignore result.
+ file->Write(data.get(), size, offset); // ignore result.
}
void BackendImpl::RestartCache(bool failure) {
« no previous file with comments | « no previous file | net/disk_cache/stats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698