Chromium Code Reviews| 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..bab0c6344254af9f92b603a0ced5d09bc78db22a 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. |
| + |
| + // GetMemoryEntryData 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 SetMemoryEntryData(|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 GetMemoryEntryData(const std::string& key); |
|
Maks Orlovich
2017/08/23 19:18:11
Suggestion from the impl CL:
pasko 2017/06/29 16:
Maks Orlovich
2017/08/25 18:36:26
Done.
|
| + virtual void SetMemoryEntryData(const std::string& key, uint8_t data); |
| }; |
| // This interface represents an entry in the disk cache. |