| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/base/host_cache.h" | 5 #include "net/base/host_cache.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "net/base/net_errors.h" | 8 #include "net/base/net_errors.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 return entries_.max_entries(); | 72 return entries_.max_entries(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 // Note that this map may contain expired entries. | 75 // Note that this map may contain expired entries. |
| 76 const HostCache::EntryMap& HostCache::entries() const { | 76 const HostCache::EntryMap& HostCache::entries() const { |
| 77 DCHECK(CalledOnValidThread()); | 77 DCHECK(CalledOnValidThread()); |
| 78 return entries_; | 78 return entries_; |
| 79 } | 79 } |
| 80 | 80 |
| 81 // static | 81 // static |
| 82 HostCache* HostCache::CreateDefaultCache() { | 82 scoped_ptr<HostCache> HostCache::CreateDefaultCache() { |
| 83 #if defined(OS_CHROMEOS) | 83 #if defined(OS_CHROMEOS) |
| 84 // Increase HostCache size for the duration of the async DNS field trial. | 84 // Increase HostCache size for the duration of the async DNS field trial. |
| 85 // http://crbug.com/143454 | 85 // http://crbug.com/143454 |
| 86 // TODO(szym): Determine the best size. http://crbug.com/114277 | 86 // TODO(szym): Determine the best size. http://crbug.com/114277 |
| 87 static const size_t kMaxHostCacheEntries = 1000; | 87 static const size_t kMaxHostCacheEntries = 1000; |
| 88 #else | 88 #else |
| 89 static const size_t kMaxHostCacheEntries = 100; | 89 static const size_t kMaxHostCacheEntries = 100; |
| 90 #endif | 90 #endif |
| 91 return new HostCache(kMaxHostCacheEntries); | 91 return make_scoped_ptr(new HostCache(kMaxHostCacheEntries)); |
| 92 } | 92 } |
| 93 | 93 |
| 94 } // namespace net | 94 } // namespace net |
| OLD | NEW |