summaryrefslogtreecommitdiff
path: root/chromium/net/dns/host_cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/dns/host_cache.h')
-rw-r--r--chromium/net/dns/host_cache.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/chromium/net/dns/host_cache.h b/chromium/net/dns/host_cache.h
index 7b2e130c839..11f92932edd 100644
--- a/chromium/net/dns/host_cache.h
+++ b/chromium/net/dns/host_cache.h
@@ -280,6 +280,18 @@ class NET_EXPORT HostCache {
using EntryMap = std::map<Key, Entry>;
+ // The two ways to serialize the cache to a value.
+ enum class SerializationType {
+ // Entries with transient NetworkIsolationKeys are not serialized, and
+ // RestoreFromListValue() can load the returned value.
+ kRestorable,
+ // Entries with transient NetworkIsolationKeys are serialized, and
+ // RestoreFromListValue() cannot load the returned value, since the debug
+ // serialization of NetworkIsolationKeys is used instead of the
+ // deserializable representation.
+ kDebug,
+ };
+
// A HostCache::EntryStaleness representing a non-stale (fresh) cache entry.
static const HostCache::EntryStaleness kNotStale;
@@ -341,15 +353,10 @@ class NET_EXPORT HostCache {
// Fills the provided base::ListValue with the contents of the cache for
// serialization. |entry_list| must be non-null and will be cleared before
- // adding the cache contents. Entries with ephemeral NetworkIsolationKeys will
- // not be written to the resulting list.
- //
- // TODO(mmenke): This is used both in combination with RestoreFromListValue()
- // and for NetLog. Update the NetLogViewer's display to handle
- // NetworkIsolationKeys, and add some way for to get a result with ephemeral
- // NIKs included.
+ // adding the cache contents.
void GetAsListValue(base::ListValue* entry_list,
- bool include_staleness) const;
+ bool include_staleness,
+ SerializationType serialization_type) const;
// Takes a base::ListValue representing cache entries and stores them in the
// cache, skipping any that already have entries. Returns true on success,
// false on failure.