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

Side by Side Diff: net/base/host_cache.cc

Issue 10831277: [net] Change factory methods for HostResolver and HostCache to return a scoped_ptr (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unnecessary initialization; respond to review Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/host_cache.h ('k') | net/base/host_resolver.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « net/base/host_cache.h ('k') | net/base/host_resolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698