| Index: net/base/host_cache.cc
|
| diff --git a/net/base/host_cache.cc b/net/base/host_cache.cc
|
| index 03eb23a01c1c97e65a3da0916041073d082eec19..dbf3bba3814f9ff983282f2a80bffef64c5cbd08 100644
|
| --- a/net/base/host_cache.cc
|
| +++ b/net/base/host_cache.cc
|
| @@ -53,13 +53,16 @@ const HostCache::Entry* HostCache::Lookup(const Key& key,
|
| HostCache::Entry* HostCache::Set(const Key& key,
|
| int error,
|
| const AddressList& addrlist,
|
| + base::TimeDelta ttl,
|
| base::TimeTicks now) {
|
| DCHECK(CalledOnValidThread());
|
| if (caching_is_disabled())
|
| return NULL;
|
|
|
| - base::TimeTicks expiration = now +
|
| - (error == OK ? success_entry_ttl_ : failure_entry_ttl_);
|
| + if (ttl == base::TimeDelta())
|
| + ttl = (error == OK ? success_entry_ttl_ : failure_entry_ttl_);
|
| +
|
| + base::TimeTicks expiration = now + ttl;
|
|
|
| scoped_refptr<Entry>& entry = entries_[key];
|
| if (!entry) {
|
| @@ -81,6 +84,13 @@ HostCache::Entry* HostCache::Set(const Key& key,
|
| }
|
| }
|
|
|
| +HostCache::Entry* HostCache::Set(const Key& key,
|
| + int error,
|
| + const AddressList& addrlist,
|
| + base::TimeTicks now) {
|
| + return Set(key, error, addrlist, base::TimeDelta(), now);
|
| +}
|
| +
|
| void HostCache::clear() {
|
| DCHECK(CalledOnValidThread());
|
| entries_.clear();
|
|
|