| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_resolver_impl.h" | 5 #include "net/base/host_resolver_impl.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <Winsock2.h> | 8 #include <Winsock2.h> |
| 9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
| 10 #include <netdb.h> | 10 #include <netdb.h> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 namespace net { | 38 namespace net { |
| 39 | 39 |
| 40 namespace { | 40 namespace { |
| 41 | 41 |
| 42 HostCache* CreateDefaultCache() { | 42 HostCache* CreateDefaultCache() { |
| 43 static const size_t kMaxHostCacheEntries = 100; | 43 static const size_t kMaxHostCacheEntries = 100; |
| 44 | 44 |
| 45 HostCache* cache = new HostCache( | 45 HostCache* cache = new HostCache( |
| 46 kMaxHostCacheEntries, | 46 kMaxHostCacheEntries, |
| 47 base::TimeDelta::FromMinutes(1), | 47 base::TimeDelta::FromMinutes(1), |
| 48 base::TimeDelta::FromMinutes(1)); | 48 base::TimeDelta::FromSeconds(0)); // Disable caching of failed DNS. |
| 49 | 49 |
| 50 return cache; | 50 return cache; |
| 51 } | 51 } |
| 52 | 52 |
| 53 } // anonymous namespace | 53 } // anonymous namespace |
| 54 | 54 |
| 55 HostResolver* CreateSystemHostResolver( | 55 HostResolver* CreateSystemHostResolver( |
| 56 NetworkChangeNotifier* network_change_notifier) { | 56 NetworkChangeNotifier* network_change_notifier) { |
| 57 // Maximum of 50 concurrent threads. | 57 // Maximum of 50 concurrent threads. |
| 58 // TODO(eroman): Adjust this, do some A/B experiments. | 58 // TODO(eroman): Adjust this, do some A/B experiments. |
| (...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1154 if (r == req) | 1154 if (r == req) |
| 1155 return error; | 1155 return error; |
| 1156 | 1156 |
| 1157 r->OnComplete(error, AddressList()); | 1157 r->OnComplete(error, AddressList()); |
| 1158 } | 1158 } |
| 1159 | 1159 |
| 1160 return ERR_IO_PENDING; | 1160 return ERR_IO_PENDING; |
| 1161 } | 1161 } |
| 1162 | 1162 |
| 1163 } // namespace net | 1163 } // namespace net |
| OLD | NEW |