| Index: net/base/host_cache.cc
|
| diff --git a/net/base/host_cache.cc b/net/base/host_cache.cc
|
| index 28173d273f164c58e71de244011ea4e1a0887bb8..03eb23a01c1c97e65a3da0916041073d082eec19 100644
|
| --- a/net/base/host_cache.cc
|
| +++ b/net/base/host_cache.cc
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2009 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| @@ -117,6 +117,18 @@ bool HostCache::CanUseEntry(const Entry* entry, const base::TimeTicks now) {
|
| return entry->expiration > now;
|
| }
|
|
|
| +// static
|
| +HostCache* HostCache::CreateDefaultCache() {
|
| + static const size_t kMaxHostCacheEntries = 100;
|
| +
|
| + HostCache* cache = new HostCache(
|
| + kMaxHostCacheEntries,
|
| + base::TimeDelta::FromMinutes(1),
|
| + base::TimeDelta::FromSeconds(0)); // Disable caching of failed DNS.
|
| +
|
| + return cache;
|
| +}
|
| +
|
| void HostCache::Compact(base::TimeTicks now, const Entry* pinned_entry) {
|
| // Clear out expired entries.
|
| for (EntryMap::iterator it = entries_.begin(); it != entries_.end(); ) {
|
|
|