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

Unified Diff: net/disk_cache/backend_impl.cc

Issue 10148001: Disk Cache: Add more corruption tracking histograms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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/addr.cc ('k') | net/disk_cache/entry_impl.cc » ('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 133063)
+++ net/disk_cache/backend_impl.cc (working copy)
@@ -447,6 +447,9 @@
return net::ERR_FAILED;
}
+ if (create_files || !data_->header.num_entries)
+ ReportError(ERR_CACHE_CREATED);
+
if (!(user_flags_ & kNoRandom) &&
cache_type_ == net::DISK_CACHE && !InitExperiment(&data_->header))
return net::ERR_FAILED;
@@ -462,7 +465,7 @@
if (data_->header.crash) {
ReportError(ERR_PREVIOUS_CRASH);
} else {
- ReportError(0);
+ ReportError(ERR_NO_ERROR);
data_->header.crash = 1;
}
@@ -484,6 +487,9 @@
disabled_ = !rankings_.Init(this, new_eviction_);
+ if (!disabled_ && !(user_flags_ & kNoRandom) && base::RandInt(0, 99) < 2)
+ rankings_.SelfCheck(); // Ignore return value for now.
+
#if defined(STRESS_CACHE_EXTENDED_VALIDATION)
trace_object_->EnableTracing(false);
int sc = SelfCheck();
@@ -1548,8 +1554,7 @@
STRESS_DCHECK(block_files_.IsValid(address));
- if (!address.is_initialized() || address.is_separate_file() ||
- address.file_type() != BLOCK_256) {
+ if (!address.SanityCheckForEntry()) {
LOG(WARNING) << "Wrong entry address.";
STRESS_NOTREACHED();
return ERR_INVALID_ADDRESS;
« no previous file with comments | « net/disk_cache/addr.cc ('k') | net/disk_cache/entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698