Chromium Code Reviews| 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; |
|
wtc
2011/11/30 00:22:09
Nit: add curly braces?
rvargas (doing something else)
2011/11/30 01:05:24
Sorry, I missed this comment. Before I change it,
wtc
2011/11/30 01:36:40
You can ignore this change request.
When I first
|
| + } |
| it->second->Release(); |
| entries_.erase(it); |
| } |