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

Unified Diff: net/http/http_cache.cc

Issue 2959183002: Start work on splitting off the usage piece of in-memory index. This revision is just from the prev…
Patch Set: Rebase Created 3 years, 3 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/http/http_cache.h ('k') | net/http/http_cache_transaction.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache.cc
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index 1b404a79ad65f2f8afd9c2c4bfe891992c853dd4..11e276e4ac1827c41be3d0a0ff3766e3fb13e44f 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -743,6 +743,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_->GetEntryInMemoryData(key);
+ if (trans->MaybeRejectBasedOnEntryInMemoryData(in_memory_info)) {
+ disk_cache_->DoomEntry(key, base::Bind([](int) {}));
+ return net::ERR_CACHE_ENTRY_NOT_SUITABLE;
+ }
+
std::unique_ptr<WorkItem> item =
std::make_unique<WorkItem>(WI_OPEN_ENTRY, trans, entry);
PendingOp* pending_op = GetPendingOp(key);
« no previous file with comments | « net/http/http_cache.h ('k') | net/http/http_cache_transaction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698