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

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

Issue 1768643002: Remove an incorrect DCHECK() when calling HostResolverImpl::Resolve() with an IP literal and HOST_RE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | net/dns/host_resolver_impl_unittest.cc » ('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/dns/host_resolver_impl.h" 5 #include "net/dns/host_resolver_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <Winsock2.h> 10 #include <Winsock2.h>
(...skipping 2074 matching lines...) Expand 10 before | Expand all | Expand 10 after
2085 bool HostResolverImpl::ResolveAsIP(const Key& key, 2085 bool HostResolverImpl::ResolveAsIP(const Key& key,
2086 const RequestInfo& info, 2086 const RequestInfo& info,
2087 const IPAddressNumber* ip_number, 2087 const IPAddressNumber* ip_number,
2088 int* net_error, 2088 int* net_error,
2089 AddressList* addresses) { 2089 AddressList* addresses) {
2090 DCHECK(addresses); 2090 DCHECK(addresses);
2091 DCHECK(net_error); 2091 DCHECK(net_error);
2092 if (ip_number == nullptr) 2092 if (ip_number == nullptr)
2093 return false; 2093 return false;
2094 2094
2095 DCHECK_EQ(key.host_resolver_flags &
2096 ~(HOST_RESOLVER_CANONNAME | HOST_RESOLVER_LOOPBACK_ONLY |
2097 HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6),
2098 0) << " Unhandled flag";
2099
2100 *net_error = OK; 2095 *net_error = OK;
2101 AddressFamily family = GetAddressFamily(*ip_number); 2096 AddressFamily family = GetAddressFamily(*ip_number);
2102 if (key.address_family != ADDRESS_FAMILY_UNSPECIFIED && 2097 if (key.address_family != ADDRESS_FAMILY_UNSPECIFIED &&
2103 key.address_family != family) { 2098 key.address_family != family) {
2104 // Don't return IPv6 addresses for IPv4 queries, and vice versa. 2099 // Don't return IPv6 addresses for IPv4 queries, and vice versa.
2105 *net_error = ERR_NAME_NOT_RESOLVED; 2100 *net_error = ERR_NAME_NOT_RESOLVED;
2106 } else { 2101 } else {
2107 *addresses = AddressList::CreateFromIPAddress(*ip_number, info.port()); 2102 *addresses = AddressList::CreateFromIPAddress(*ip_number, info.port());
2108 if (key.host_resolver_flags & HOST_RESOLVER_CANONNAME) 2103 if (key.host_resolver_flags & HOST_RESOLVER_CANONNAME)
2109 addresses->SetDefaultCanonicalName(); 2104 addresses->SetDefaultCanonicalName();
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
2458 dns_client_->SetConfig(dns_config); 2453 dns_client_->SetConfig(dns_config);
2459 num_dns_failures_ = 0; 2454 num_dns_failures_ = 0;
2460 if (dns_client_->GetConfig()) 2455 if (dns_client_->GetConfig())
2461 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true); 2456 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true);
2462 } 2457 }
2463 2458
2464 AbortDnsTasks(); 2459 AbortDnsTasks();
2465 } 2460 }
2466 2461
2467 } // namespace net 2462 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/dns/host_resolver_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698