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 2112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2123 | 2123 |
2124 std::unique_ptr<base::Value> HostResolverImpl::GetDnsConfigAsValue() const { | 2124 std::unique_ptr<base::Value> HostResolverImpl::GetDnsConfigAsValue() const { |
2125 // Check if async DNS is disabled. | 2125 // Check if async DNS is disabled. |
2126 if (!dns_client_.get()) | 2126 if (!dns_client_.get()) |
2127 return nullptr; | 2127 return nullptr; |
2128 | 2128 |
2129 // Check if async DNS is enabled, but we currently have no configuration | 2129 // Check if async DNS is enabled, but we currently have no configuration |
2130 // for it. | 2130 // for it. |
2131 const DnsConfig* dns_config = dns_client_->GetConfig(); | 2131 const DnsConfig* dns_config = dns_client_->GetConfig(); |
2132 if (!dns_config) | 2132 if (!dns_config) |
2133 return base::WrapUnique(new base::DictionaryValue()); | 2133 return base::MakeUnique<base::DictionaryValue>(); |
2134 | 2134 |
2135 return dns_config->ToValue(); | 2135 return dns_config->ToValue(); |
2136 } | 2136 } |
2137 | 2137 |
2138 int HostResolverImpl::ResolveStaleFromCache( | 2138 int HostResolverImpl::ResolveStaleFromCache( |
2139 const RequestInfo& info, | 2139 const RequestInfo& info, |
2140 AddressList* addresses, | 2140 AddressList* addresses, |
2141 HostCache::EntryStaleness* stale_info, | 2141 HostCache::EntryStaleness* stale_info, |
2142 const BoundNetLog& source_net_log) { | 2142 const BoundNetLog& source_net_log) { |
2143 DCHECK(CalledOnValidThread()); | 2143 DCHECK(CalledOnValidThread()); |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2606 if (job_) | 2606 if (job_) |
2607 job_->CancelRequest(this); | 2607 job_->CancelRequest(this); |
2608 } | 2608 } |
2609 | 2609 |
2610 void HostResolverImpl::RequestImpl::ChangeRequestPriority( | 2610 void HostResolverImpl::RequestImpl::ChangeRequestPriority( |
2611 RequestPriority priority) { | 2611 RequestPriority priority) { |
2612 job_->ChangeRequestPriority(this, priority); | 2612 job_->ChangeRequestPriority(this, priority); |
2613 } | 2613 } |
2614 | 2614 |
2615 } // namespace net | 2615 } // namespace net |
OLD | NEW |