| Index: net/proxy/proxy_resolver_v8_tracing.cc
|
| diff --git a/net/proxy/proxy_resolver_v8_tracing.cc b/net/proxy/proxy_resolver_v8_tracing.cc
|
| index f772dc1271f943e4d28624b212c11aa64ea92917..2fe2c6a1bf9ad5f5ffd1ef55127189a00f9ca139 100644
|
| --- a/net/proxy/proxy_resolver_v8_tracing.cc
|
| +++ b/net/proxy/proxy_resolver_v8_tracing.cc
|
| @@ -847,23 +847,36 @@ void ProxyResolverV8Tracing::Job::DoDnsOperation() {
|
| return;
|
|
|
| HostResolver::RequestHandle dns_request = NULL;
|
| - int result = host_resolver()->Resolve(
|
| - MakeDnsRequestInfo(pending_dns_host_, pending_dns_op_),
|
| - DEFAULT_PRIORITY,
|
| - &pending_dns_addresses_,
|
| - base::Bind(&Job::OnDnsOperationComplete, this),
|
| - &dns_request,
|
| - bound_net_log_);
|
| -
|
| - pending_dns_completed_synchronously_ = result != ERR_IO_PENDING;
|
| -
|
| - // Check if the request was cancelled as a side-effect of calling into the
|
| - // HostResolver. This isn't the ordinary execution flow, however it is
|
| - // exercised by unit-tests.
|
| - if (cancelled_.IsSet()) {
|
| - if (!pending_dns_completed_synchronously_)
|
| - host_resolver()->CancelRequest(dns_request);
|
| - return;
|
| + int result = OK;
|
| + pending_dns_completed_synchronously_ = false;
|
| +
|
| + // If a system (e.g. Chrome OS) has specified an IP address, use it.
|
| + if (pending_dns_op_ == MY_IP_ADDRESS || pending_dns_op_ == MY_IP_ADDRESS_EX) {
|
| + bool include_ipv6 = pending_dns_op_ == MY_IP_ADDRESS_EX;
|
| + if (host_resolver()->ResolveFromMyIpAddress(include_ipv6,
|
| + &pending_dns_addresses_)) {
|
| + pending_dns_completed_synchronously_ = true;
|
| + }
|
| + }
|
| +
|
| + if (!pending_dns_completed_synchronously_) {
|
| + result = host_resolver()->Resolve(
|
| + MakeDnsRequestInfo(pending_dns_host_, pending_dns_op_),
|
| + DEFAULT_PRIORITY,
|
| + &pending_dns_addresses_,
|
| + base::Bind(&Job::OnDnsOperationComplete, this),
|
| + &dns_request,
|
| + bound_net_log_);
|
| + pending_dns_completed_synchronously_ = result != ERR_IO_PENDING;
|
| +
|
| + // Check if the request was cancelled as a side-effect of calling into the
|
| + // HostResolver. This isn't the ordinary execution flow, however it is
|
| + // exercised by unit-tests.
|
| + if (cancelled_.IsSet()) {
|
| + if (!pending_dns_completed_synchronously_)
|
| + host_resolver()->CancelRequest(dns_request);
|
| + return;
|
| + }
|
| }
|
|
|
| if (pending_dns_completed_synchronously_) {
|
|
|