| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromeos/network/host_resolver_impl_chromeos.h" | 5 #include "chromeos/network/host_resolver_impl_chromeos.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 base::ThreadTaskRunnerHandle::Get(), network_state_handler)); | 136 base::ThreadTaskRunnerHandle::Get(), network_state_handler)); |
| 137 } | 137 } |
| 138 | 138 |
| 139 HostResolverImplChromeOS::~HostResolverImplChromeOS() { | 139 HostResolverImplChromeOS::~HostResolverImplChromeOS() { |
| 140 } | 140 } |
| 141 | 141 |
| 142 int HostResolverImplChromeOS::Resolve(const RequestInfo& info, | 142 int HostResolverImplChromeOS::Resolve(const RequestInfo& info, |
| 143 net::RequestPriority priority, | 143 net::RequestPriority priority, |
| 144 net::AddressList* addresses, | 144 net::AddressList* addresses, |
| 145 const net::CompletionCallback& callback, | 145 const net::CompletionCallback& callback, |
| 146 RequestHandle* out_req, | 146 std::unique_ptr<Request>* out_req, |
| 147 const net::BoundNetLog& source_net_log) { | 147 const net::BoundNetLog& source_net_log) { |
| 148 DCHECK(thread_checker_.CalledOnValidThread()); | 148 DCHECK(thread_checker_.CalledOnValidThread()); |
| 149 if (ResolveLocalIPAddress(info, addresses)) | 149 if (ResolveLocalIPAddress(info, addresses)) |
| 150 return net::OK; | 150 return net::OK; |
| 151 return net::HostResolverImpl::Resolve( | 151 return net::HostResolverImpl::Resolve( |
| 152 info, priority, addresses, callback, out_req, source_net_log); | 152 info, priority, addresses, callback, out_req, source_net_log); |
| 153 } | 153 } |
| 154 | 154 |
| 155 void HostResolverImplChromeOS::SetIPAddresses(const std::string& ipv4_address, | 155 void HostResolverImplChromeOS::SetIPAddresses(const std::string& ipv4_address, |
| 156 const std::string& ipv6_address) { | 156 const std::string& ipv6_address) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 std::unique_ptr<net::HostResolver> | 201 std::unique_ptr<net::HostResolver> |
| 202 HostResolverImplChromeOS::CreateHostResolverForTest( | 202 HostResolverImplChromeOS::CreateHostResolverForTest( |
| 203 scoped_refptr<base::SingleThreadTaskRunner> network_handler_task_runner, | 203 scoped_refptr<base::SingleThreadTaskRunner> network_handler_task_runner, |
| 204 NetworkStateHandler* network_state_handler) { | 204 NetworkStateHandler* network_state_handler) { |
| 205 Options options; | 205 Options options; |
| 206 return std::unique_ptr<net::HostResolver>(new HostResolverImplChromeOS( | 206 return std::unique_ptr<net::HostResolver>(new HostResolverImplChromeOS( |
| 207 network_handler_task_runner, network_state_handler, options, NULL)); | 207 network_handler_task_runner, network_state_handler, options, NULL)); |
| 208 } | 208 } |
| 209 | 209 |
| 210 } // namespace chromeos | 210 } // namespace chromeos |
| OLD | NEW |