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

Unified Diff: net/disk_cache/disk_cache.h

Issue 2958033002: Interface for associating in-memory hint bytes with disk cache entries. (Closed)
Patch Set: Rebase Created 3 years, 4 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 | « no previous file | net/disk_cache/disk_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/disk_cache.h
diff --git a/net/disk_cache/disk_cache.h b/net/disk_cache/disk_cache.h
index dbafe94f440d46fd5bc7354452980127708fdad8..2429402205257b88daff530f3d797f3a71c8049c 100644
--- a/net/disk_cache/disk_cache.h
+++ b/net/disk_cache/disk_cache.h
@@ -223,6 +223,21 @@ 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 of an existing entry in memory.
+
+ // GetEntryInMemoryData has the following behavior:
+ // - If the data is not available at this time for any reason, returns 0.
+ // - Otherwise, returns a value that was with very high probability
+ // given to SetEntryInMemoryData(|key|) (and with a very low probability
+ // to a different key that collides in the in-memory index).
+ //
+ // Due to the probability of collisions, including those that can be induced
+ // by hostile 3rd parties, this interface should not be used to make decisions
+ // that affect correctness (especially security).
+ virtual uint8_t GetEntryInMemoryData(const std::string& key);
+ virtual void SetEntryInMemoryData(const std::string& key, uint8_t data);
};
// This interface represents an entry in the disk cache.
« no previous file with comments | « no previous file | net/disk_cache/disk_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698