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