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

Unified Diff: net/disk_cache/simple/simple_backend_impl.cc

Issue 2922973003: RFC: use some in-memory state in SimpleCache to quickly cache-miss some CantConditionalize cases
Patch Set: omewhat better take at higher-level HC::T impl, a bit lessy hacky, and actually write to cache now. Created 3 years, 6 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
Index: net/disk_cache/simple/simple_backend_impl.cc
diff --git a/net/disk_cache/simple/simple_backend_impl.cc b/net/disk_cache/simple/simple_backend_impl.cc
index 88d2741e9797f8452efeea09fa1bbd376ed9354b..5efc44ab19d11b6b6838a5a93cf6e3968a174c1b 100644
--- a/net/disk_cache/simple/simple_backend_impl.cc
+++ b/net/disk_cache/simple/simple_backend_impl.cc
@@ -576,6 +576,17 @@ size_t SimpleBackendImpl::DumpMemoryStats(
return size;
}
+uint8_t SimpleBackendImpl::GetMemoryEntryData(const std::string& key) {
+ const uint64_t entry_hash = simple_util::GetEntryHashKey(key);
+ return index_->GetMemoryEntryData(entry_hash);
+}
+
+void SimpleBackendImpl::SetMemoryEntryData(const std::string& key,
+ uint8_t data) {
+ const uint64_t entry_hash = simple_util::GetEntryHashKey(key);
+ index_->SetMemoryEntryData(entry_hash, data);
+}
+
void SimpleBackendImpl::InitializeIndex(const CompletionCallback& callback,
const DiskStatResult& result) {
if (result.net_error == net::OK) {

Powered by Google App Engine
This is Rietveld 408576698