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

Side by Side Diff: net/dns/host_resolver_impl.cc

Issue 1215933004: New new versions of Starts/EndsWith and SplitString in net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@starts_with
Patch Set: Created 5 years, 5 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
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/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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 271
272 bool ConfigureAsyncDnsNoFallbackFieldTrial() { 272 bool ConfigureAsyncDnsNoFallbackFieldTrial() {
273 const bool kDefault = false; 273 const bool kDefault = false;
274 274
275 // Configure the AsyncDns field trial as follows: 275 // Configure the AsyncDns field trial as follows:
276 // groups AsyncDnsNoFallbackA and AsyncDnsNoFallbackB: return true, 276 // groups AsyncDnsNoFallbackA and AsyncDnsNoFallbackB: return true,
277 // groups AsyncDnsA and AsyncDnsB: return false, 277 // groups AsyncDnsA and AsyncDnsB: return false,
278 // groups SystemDnsA and SystemDnsB: return false, 278 // groups SystemDnsA and SystemDnsB: return false,
279 // otherwise (trial absent): return default. 279 // otherwise (trial absent): return default.
280 std::string group_name = base::FieldTrialList::FindFullName("AsyncDns"); 280 std::string group_name = base::FieldTrialList::FindFullName("AsyncDns");
281 if (!group_name.empty()) 281 if (!group_name.empty()) {
282 return base::StartsWithASCII(group_name, "AsyncDnsNoFallback", false); 282 return base::StartsWith(group_name, "AsyncDnsNoFallback",
283 base::CompareCase::INSENSITIVE_ASCII);
284 }
283 return kDefault; 285 return kDefault;
284 } 286 }
285 287
286 //----------------------------------------------------------------------------- 288 //-----------------------------------------------------------------------------
287 289
288 AddressList EnsurePortOnAddressList(const AddressList& list, uint16 port) { 290 AddressList EnsurePortOnAddressList(const AddressList& list, uint16 port) {
289 if (list.empty() || list.front().port() == port) 291 if (list.empty() || list.front().port() == port)
290 return list; 292 return list;
291 return AddressList::CopyWithPort(list, port); 293 return AddressList::CopyWithPort(list, port);
292 } 294 }
(...skipping 2138 matching lines...) Expand 10 before | Expand all | Expand 10 after
2431 dns_client_->SetConfig(dns_config); 2433 dns_client_->SetConfig(dns_config);
2432 num_dns_failures_ = 0; 2434 num_dns_failures_ = 0;
2433 if (dns_client_->GetConfig()) 2435 if (dns_client_->GetConfig())
2434 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true); 2436 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true);
2435 } 2437 }
2436 2438
2437 AbortDnsTasks(); 2439 AbortDnsTasks();
2438 } 2440 }
2439 2441
2440 } // namespace net 2442 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698