Index: net/http/http_cache.cc |
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc |
index 68aee907e43674a7f207f496fa7ac2df8f8ccce9..6b4bd9f42ffb67b6c187aa15eb4e214c1e4ee2d6 100644 |
--- a/net/http/http_cache.cc |
+++ b/net/http/http_cache.cc |
@@ -739,7 +739,8 @@ void HttpCache::DeletePendingOp(PendingOp* pending_op) { |
delete pending_op; |
} |
-int HttpCache::OpenEntry(const std::string& key, ActiveEntry** entry, |
+int HttpCache::OpenEntry(const std::string& key, |
+ ActiveEntry** entry, |
Transaction* trans) { |
ActiveEntry* active_entry = FindActiveEntry(key); |
if (active_entry) { |
@@ -747,6 +748,13 @@ int HttpCache::OpenEntry(const std::string& key, ActiveEntry** entry, |
return OK; |
} |
+ // See if we could potentially quick-reject the entry. |
+ uint8_t in_memory_info = disk_cache_->GetMemoryEntryData(key); |
+ if (trans->MaybeRejectBasedOnMemoryEntryData(in_memory_info)) { |
+ disk_cache_->DoomEntry(key, base::Bind([](int) {})); |
+ return net::ERR_CACHE_ENTRY_NOT_SUITABLE; |
+ } |
+ |
std::unique_ptr<WorkItem> item = |
base::MakeUnique<WorkItem>(WI_OPEN_ENTRY, trans, entry); |
PendingOp* pending_op = GetPendingOp(key); |