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/dns/host_resolver_impl.h" | 5 #include "net/dns/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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 bool ConfigureAsyncDnsNoFallbackFieldTrial() { | 274 bool ConfigureAsyncDnsNoFallbackFieldTrial() { |
275 const bool kDefault = false; | 275 const bool kDefault = false; |
276 | 276 |
277 // Configure the AsyncDns field trial as follows: | 277 // Configure the AsyncDns field trial as follows: |
278 // groups AsyncDnsNoFallbackA and AsyncDnsNoFallbackB: return true, | 278 // groups AsyncDnsNoFallbackA and AsyncDnsNoFallbackB: return true, |
279 // groups AsyncDnsA and AsyncDnsB: return false, | 279 // groups AsyncDnsA and AsyncDnsB: return false, |
280 // groups SystemDnsA and SystemDnsB: return false, | 280 // groups SystemDnsA and SystemDnsB: return false, |
281 // otherwise (trial absent): return default. | 281 // otherwise (trial absent): return default. |
282 std::string group_name = base::FieldTrialList::FindFullName("AsyncDns"); | 282 std::string group_name = base::FieldTrialList::FindFullName("AsyncDns"); |
283 if (!group_name.empty()) | 283 if (!group_name.empty()) |
284 return StartsWithASCII(group_name, "AsyncDnsNoFallback", false); | 284 return base::StartsWithASCII(group_name, "AsyncDnsNoFallback", false); |
285 return kDefault; | 285 return kDefault; |
286 } | 286 } |
287 | 287 |
288 //----------------------------------------------------------------------------- | 288 //----------------------------------------------------------------------------- |
289 | 289 |
290 AddressList EnsurePortOnAddressList(const AddressList& list, uint16 port) { | 290 AddressList EnsurePortOnAddressList(const AddressList& list, uint16 port) { |
291 if (list.empty() || list.front().port() == port) | 291 if (list.empty() || list.front().port() == port) |
292 return list; | 292 return list; |
293 return AddressList::CopyWithPort(list, port); | 293 return AddressList::CopyWithPort(list, port); |
294 } | 294 } |
(...skipping 2117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2412 dns_client_->SetConfig(dns_config); | 2412 dns_client_->SetConfig(dns_config); |
2413 num_dns_failures_ = 0; | 2413 num_dns_failures_ = 0; |
2414 if (dns_client_->GetConfig()) | 2414 if (dns_client_->GetConfig()) |
2415 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true); | 2415 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true); |
2416 } | 2416 } |
2417 | 2417 |
2418 AbortDnsTasks(); | 2418 AbortDnsTasks(); |
2419 } | 2419 } |
2420 | 2420 |
2421 } // namespace net | 2421 } // namespace net |
OLD | NEW |