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

Unified Diff: net/disk_cache/disk_cache.h

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/disk_cache.h
diff --git a/net/disk_cache/disk_cache.h b/net/disk_cache/disk_cache.h
index 4a3ae119b53f9c90b22f5c70379e5d4fb0f1f057..19fcf0529c56d27a1d0f4fc921e3c07ab947b58f 100644
--- a/net/disk_cache/disk_cache.h
+++ b/net/disk_cache/disk_cache.h
@@ -184,6 +184,15 @@ class NET_EXPORT Backend {
virtual size_t DumpMemoryStats(
base::trace_event::ProcessMemoryDump* pmd,
const std::string& parent_absolute_name) const = 0;
+
+ // Backends can optionally permit one to store, probabilistically, up to a
+ // byte associated with a key (for an existing entry). Accessing the key is
+ // guaranteed to be cheap, but the method is permitted to return 0, and may,
+ // with low probability, even return values associated with the wrong key in
+ // case of collisions. Therefore it should not be used to make decisions that
+ // affect correctness (especially security).
+ virtual uint8_t GetMemoryEntryData(const std::string& key);
+ virtual void SetMemoryEntryData(const std::string& key, uint8_t data);
};
// This interface represents an entry in the disk cache.

Powered by Google App Engine
This is Rietveld 408576698