| 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/base/mapped_host_resolver.h" | 5 #include "net/base/mapped_host_resolver.h" |
| 6 | 6 |
| 7 #include "base/string_tokenizer.h" | 7 #include "base/string_tokenizer.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "net/base/host_port_pair.h" | 9 #include "net/base/host_port_pair.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| 11 #include "net/base/net_util.h" | 11 #include "net/base/net_util.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 MappedHostResolver::MappedHostResolver(HostResolver* impl) | 15 MappedHostResolver::MappedHostResolver(scoped_ptr<HostResolver> impl) |
| 16 : impl_(impl) { | 16 : impl_(impl.Pass()) { |
| 17 } | 17 } |
| 18 | 18 |
| 19 MappedHostResolver::~MappedHostResolver() { | 19 MappedHostResolver::~MappedHostResolver() { |
| 20 } | 20 } |
| 21 | 21 |
| 22 int MappedHostResolver::Resolve(const RequestInfo& info, | 22 int MappedHostResolver::Resolve(const RequestInfo& info, |
| 23 AddressList* addresses, | 23 AddressList* addresses, |
| 24 const CompletionCallback& callback, | 24 const CompletionCallback& callback, |
| 25 RequestHandle* out_req, | 25 RequestHandle* out_req, |
| 26 const BoundNetLog& net_log) { | 26 const BoundNetLog& net_log) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 49 HostResolver::RequestInfo MappedHostResolver::ApplyRules( | 49 HostResolver::RequestInfo MappedHostResolver::ApplyRules( |
| 50 const RequestInfo& info) const { | 50 const RequestInfo& info) const { |
| 51 RequestInfo modified_info = info; | 51 RequestInfo modified_info = info; |
| 52 HostPortPair host_port(info.host_port_pair()); | 52 HostPortPair host_port(info.host_port_pair()); |
| 53 if (rules_.RewriteHost(&host_port)) | 53 if (rules_.RewriteHost(&host_port)) |
| 54 modified_info.set_host_port_pair(host_port); | 54 modified_info.set_host_port_pair(host_port); |
| 55 return modified_info; | 55 return modified_info; |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace net | 58 } // namespace net |
| OLD | NEW |