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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 weak_ptr_factory_(this) { | 132 weak_ptr_factory_(this) { |
133 network_handler_task_runner->PostTask( | 133 network_handler_task_runner->PostTask( |
134 FROM_HERE, | 134 FROM_HERE, |
135 base::Bind(&NetworkObserver::Create, weak_ptr_factory_.GetWeakPtr(), | 135 base::Bind(&NetworkObserver::Create, weak_ptr_factory_.GetWeakPtr(), |
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( |
143 net::RequestPriority priority, | 143 const RequestInfo& info, |
144 net::AddressList* addresses, | 144 net::RequestPriority priority, |
145 const net::CompletionCallback& callback, | 145 net::AddressList* addresses, |
146 std::unique_ptr<Request>* out_req, | 146 const net::CompletionCallback& callback, |
147 const net::BoundNetLog& source_net_log) { | 147 std::unique_ptr<Request>* out_req, |
| 148 const net::NetLogWithSource& source_net_log) { |
148 DCHECK(thread_checker_.CalledOnValidThread()); | 149 DCHECK(thread_checker_.CalledOnValidThread()); |
149 if (ResolveLocalIPAddress(info, addresses)) | 150 if (ResolveLocalIPAddress(info, addresses)) |
150 return net::OK; | 151 return net::OK; |
151 return net::HostResolverImpl::Resolve( | 152 return net::HostResolverImpl::Resolve( |
152 info, priority, addresses, callback, out_req, source_net_log); | 153 info, priority, addresses, callback, out_req, source_net_log); |
153 } | 154 } |
154 | 155 |
155 void HostResolverImplChromeOS::SetIPAddresses(const std::string& ipv4_address, | 156 void HostResolverImplChromeOS::SetIPAddresses(const std::string& ipv4_address, |
156 const std::string& ipv6_address) { | 157 const std::string& ipv6_address) { |
157 DCHECK(thread_checker_.CalledOnValidThread()); | 158 DCHECK(thread_checker_.CalledOnValidThread()); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 std::unique_ptr<net::HostResolver> | 202 std::unique_ptr<net::HostResolver> |
202 HostResolverImplChromeOS::CreateHostResolverForTest( | 203 HostResolverImplChromeOS::CreateHostResolverForTest( |
203 scoped_refptr<base::SingleThreadTaskRunner> network_handler_task_runner, | 204 scoped_refptr<base::SingleThreadTaskRunner> network_handler_task_runner, |
204 NetworkStateHandler* network_state_handler) { | 205 NetworkStateHandler* network_state_handler) { |
205 Options options; | 206 Options options; |
206 return std::unique_ptr<net::HostResolver>(new HostResolverImplChromeOS( | 207 return std::unique_ptr<net::HostResolver>(new HostResolverImplChromeOS( |
207 network_handler_task_runner, network_state_handler, options, NULL)); | 208 network_handler_task_runner, network_state_handler, options, NULL)); |
208 } | 209 } |
209 | 210 |
210 } // namespace chromeos | 211 } // namespace chromeos |
OLD | NEW |