Index: net/http/mock_http_cache.cc |
=================================================================== |
--- net/http/mock_http_cache.cc (revision 111217) |
+++ net/http/mock_http_cache.cc (working copy) |
@@ -341,7 +341,7 @@ |
MockDiskCache::MockDiskCache() |
: open_count_(0), create_count_(0), fail_requests_(false), |
- soft_failures_(false) { |
+ soft_failures_(false), double_create_check_(true) { |
} |
MockDiskCache::~MockDiskCache() { |
@@ -392,7 +392,12 @@ |
EntryMap::iterator it = entries_.find(key); |
if (it != entries_.end()) { |
- DCHECK(it->second->is_doomed()); |
+ if (!it->second->is_doomed()) { |
+ if (double_create_check_) |
+ NOTREACHED(); |
+ else |
+ return net::ERR_CACHE_CREATE_FAILURE; |
+ } |
it->second->Release(); |
entries_.erase(it); |
} |