Lines Matching refs:entry
14 HostCache::Entry::Entry(int error,
20 HostCache::Entry::~Entry() {
36 const HostCache::Entry* HostCache::Lookup(const Key& key,
46 Entry* entry = it->second.get();
47 if (CanUseEntry(entry, now))
48 return entry;
53 HostCache::Entry* HostCache::Set(const Key& key,
64 scoped_refptr<Entry>& entry = entries_[key];
65 if (!entry) {
66 // Entry didn't exist, creating one now.
67 Entry* ptr = new Entry(error, addrlist, expiration);
68 entry = ptr;
70 // Compact the cache if we grew it beyond limit -- exclude |entry| from
76 // Update an existing cache entry.
77 entry->error = error;
78 entry->addrlist = addrlist;
79 entry->expiration = expiration;
80 return entry.get();
116 bool HostCache::CanUseEntry(const Entry* entry, const base::TimeTicks now) {
117 return entry->expiration > now;
120 void HostCache::Compact(base::TimeTicks now, const Entry* pinned_entry) {
123 Entry* entry = (it->second).get();
124 if (entry != pinned_entry && !CanUseEntry(entry, now)) {
140 Entry* entry = (it->second).get();
141 if (entry != pinned_entry) {