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

Unified Diff: net/disk_cache/stats.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 | « net/disk_cache/stats.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/stats.cc
===================================================================
--- net/disk_cache/stats.cc (revision 201943)
+++ net/disk_cache/stats.cc (working copy)
@@ -207,10 +207,10 @@
return total;
}
-bool Stats::SerializeStats(void* data, int num_bytes, Addr* address) {
+int Stats::SerializeStats(void* data, int num_bytes, Addr* address) {
OnDiskStats* stats = reinterpret_cast<OnDiskStats*>(data);
if (num_bytes < static_cast<int>(sizeof(*stats)))
- return false;
+ return 0;
stats->signature = kDiskSignature;
stats->size = sizeof(stats);
@@ -218,7 +218,7 @@
memcpy(stats->counters, counters_, sizeof(counters_));
*address = storage_addr_;
- return true;
+ return sizeof(*stats);
}
int Stats::GetBucketRange(size_t i) const {
« no previous file with comments | « net/disk_cache/stats.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698