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/mapped_host_resolver.h" | 5 #include "net/dns/mapped_host_resolver.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
8 #include "net/base/host_port_pair.h" | 10 #include "net/base/host_port_pair.h" |
9 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
10 #include "net/base/net_util.h" | 12 #include "net/base/net_util.h" |
11 | 13 |
12 namespace net { | 14 namespace net { |
13 | 15 |
14 MappedHostResolver::MappedHostResolver(scoped_ptr<HostResolver> impl) | 16 MappedHostResolver::MappedHostResolver(scoped_ptr<HostResolver> impl) |
15 : impl_(impl.Pass()) { | 17 : impl_(std::move(impl)) {} |
16 } | |
17 | 18 |
18 MappedHostResolver::~MappedHostResolver() { | 19 MappedHostResolver::~MappedHostResolver() { |
19 } | 20 } |
20 | 21 |
21 int MappedHostResolver::Resolve(const RequestInfo& original_info, | 22 int MappedHostResolver::Resolve(const RequestInfo& original_info, |
22 RequestPriority priority, | 23 RequestPriority priority, |
23 AddressList* addresses, | 24 AddressList* addresses, |
24 const CompletionCallback& callback, | 25 const CompletionCallback& callback, |
25 RequestHandle* out_req, | 26 RequestHandle* out_req, |
26 const BoundNetLog& net_log) { | 27 const BoundNetLog& net_log) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 HostPortPair host_port(info->host_port_pair()); | 64 HostPortPair host_port(info->host_port_pair()); |
64 if (rules_.RewriteHost(&host_port)) { | 65 if (rules_.RewriteHost(&host_port)) { |
65 if (host_port.host() == "~NOTFOUND") | 66 if (host_port.host() == "~NOTFOUND") |
66 return ERR_NAME_NOT_RESOLVED; | 67 return ERR_NAME_NOT_RESOLVED; |
67 info->set_host_port_pair(host_port); | 68 info->set_host_port_pair(host_port); |
68 } | 69 } |
69 return OK; | 70 return OK; |
70 } | 71 } |
71 | 72 |
72 } // namespace net | 73 } // namespace net |
OLD | NEW |