| 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 "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "net/base/host_port_pair.h" | 8 #include "net/base/host_port_pair.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/base/net_util.h" | 10 #include "net/base/net_util.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 } | 48 } |
| 49 | 49 |
| 50 void MappedHostResolver::SetDnsClientEnabled(bool enabled) { | 50 void MappedHostResolver::SetDnsClientEnabled(bool enabled) { |
| 51 impl_->SetDnsClientEnabled(enabled); | 51 impl_->SetDnsClientEnabled(enabled); |
| 52 } | 52 } |
| 53 | 53 |
| 54 HostCache* MappedHostResolver::GetHostCache() { | 54 HostCache* MappedHostResolver::GetHostCache() { |
| 55 return impl_->GetHostCache(); | 55 return impl_->GetHostCache(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 base::Value* MappedHostResolver::GetDnsConfigAsValue() const { | 58 scoped_ptr<base::Value> MappedHostResolver::GetDnsConfigAsValue() const { |
| 59 return impl_->GetDnsConfigAsValue(); | 59 return impl_->GetDnsConfigAsValue(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 int MappedHostResolver::ApplyRules(RequestInfo* info) const { | 62 int MappedHostResolver::ApplyRules(RequestInfo* info) const { |
| 63 HostPortPair host_port(info->host_port_pair()); | 63 HostPortPair host_port(info->host_port_pair()); |
| 64 if (rules_.RewriteHost(&host_port)) { | 64 if (rules_.RewriteHost(&host_port)) { |
| 65 if (host_port.host() == "~NOTFOUND") | 65 if (host_port.host() == "~NOTFOUND") |
| 66 return ERR_NAME_NOT_RESOLVED; | 66 return ERR_NAME_NOT_RESOLVED; |
| 67 info->set_host_port_pair(host_port); | 67 info->set_host_port_pair(host_port); |
| 68 } | 68 } |
| 69 return OK; | 69 return OK; |
| 70 } | 70 } |
| 71 | 71 |
| 72 } // namespace net | 72 } // namespace net |
| OLD | NEW |