Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Unified Diff: net/base/host_cache.cc

Issue 302010: Add a mechanism to disable IPv6.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address darin's comments Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/base/host_cache.cc
===================================================================
--- net/base/host_cache.cc (revision 29420)
+++ net/base/host_cache.cc (working copy)
@@ -29,12 +29,12 @@
HostCache::~HostCache() {
}
-const HostCache::Entry* HostCache::Lookup(const std::string& hostname,
+const HostCache::Entry* HostCache::Lookup(const Key& key,
base::TimeTicks now) const {
if (caching_is_disabled())
return NULL;
- EntryMap::const_iterator it = entries_.find(hostname);
+ EntryMap::const_iterator it = entries_.find(key);
if (it == entries_.end())
return NULL; // Not found.
@@ -45,7 +45,7 @@
return NULL;
}
-HostCache::Entry* HostCache::Set(const std::string& hostname,
+HostCache::Entry* HostCache::Set(const Key& key,
int error,
const AddressList addrlist,
base::TimeTicks now) {
@@ -55,7 +55,7 @@
base::TimeTicks expiration = now +
base::TimeDelta::FromMilliseconds(cache_duration_ms_);
- scoped_refptr<Entry>& entry = entries_[hostname];
+ scoped_refptr<Entry>& entry = entries_[key];
if (!entry) {
// Entry didn't exist, creating one now.
Entry* ptr = new Entry(error, addrlist, expiration);

Powered by Google App Engine
This is Rietveld 408576698