Chromium Code Reviews| Index: net/base/host_cache.h |
| diff --git a/net/base/host_cache.h b/net/base/host_cache.h |
| index 7aff49c1ba16dc85cd145c9298ed2314e3ad953e..9484de21365337b901a1ea8b43087bf61eb5fbee 100644 |
| --- a/net/base/host_cache.h |
| +++ b/net/base/host_cache.h |
| @@ -23,12 +23,17 @@ class NET_EXPORT HostCache : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
| public: |
| // Stores the latest address list that was looked up for a hostname. |
| struct Entry { |
| + Entry(int error, const AddressList& addrlist, base::TimeDelta ttl); |
| + // As above, but sets |ttl| to negative. |
|
cbentzel
2012/10/13 10:50:45
This comment actually confuses things a bit - it's
|
| Entry(int error, const AddressList& addrlist); |
| ~Entry(); |
| + bool has_ttl() const { return ttl >= base::TimeDelta(); } |
| + |
| // The resolve results for this entry. |
| int error; |
| AddressList addrlist; |
| + base::TimeDelta ttl; |
| }; |
| struct Key { |
| @@ -67,11 +72,10 @@ class NET_EXPORT HostCache : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
| const Entry* Lookup(const Key& key, base::TimeTicks now); |
| // Overwrites or creates an entry for |key|. |
| - // (|error|, |addrlist|) is the value to set, |now| is the current time |
| + // |entry| is the value to set, |now| is the current time |
| // |ttl| is the "time to live". |
| void Set(const Key& key, |
| - int error, |
| - const AddressList& addrlist, |
| + const Entry& entry, |
| base::TimeTicks now, |
| base::TimeDelta ttl); |