Chromium Code Reviews| 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> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 } | 49 } |
| 50 | 50 |
| 51 HostCache* MappedHostResolver::GetHostCache() { | 51 HostCache* MappedHostResolver::GetHostCache() { |
| 52 return impl_->GetHostCache(); | 52 return impl_->GetHostCache(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 std::unique_ptr<base::Value> MappedHostResolver::GetDnsConfigAsValue() const { | 55 std::unique_ptr<base::Value> MappedHostResolver::GetDnsConfigAsValue() const { |
| 56 return impl_->GetDnsConfigAsValue(); | 56 return impl_->GetDnsConfigAsValue(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void MappedHostResolver::SetDefaultAddressFamily(AddressFamily address_family) { | |
|
xunjieli
2017/02/27 15:37:39
Is this needed? Cronet only use mapped host resolv
mgersh
2017/02/28 18:29:57
It's needed for the unit test to work the way it's
| |
| 60 impl_->SetDefaultAddressFamily(address_family); | |
| 61 } | |
| 62 | |
| 63 AddressFamily MappedHostResolver::GetDefaultAddressFamily() const { | |
| 64 return impl_->GetDefaultAddressFamily(); | |
| 65 } | |
| 66 | |
| 59 int MappedHostResolver::ApplyRules(RequestInfo* info) const { | 67 int MappedHostResolver::ApplyRules(RequestInfo* info) const { |
| 60 HostPortPair host_port(info->host_port_pair()); | 68 HostPortPair host_port(info->host_port_pair()); |
| 61 if (rules_.RewriteHost(&host_port)) { | 69 if (rules_.RewriteHost(&host_port)) { |
| 62 if (host_port.host() == "~NOTFOUND") | 70 if (host_port.host() == "~NOTFOUND") |
| 63 return ERR_NAME_NOT_RESOLVED; | 71 return ERR_NAME_NOT_RESOLVED; |
| 64 info->set_host_port_pair(host_port); | 72 info->set_host_port_pair(host_port); |
| 65 } | 73 } |
| 66 return OK; | 74 return OK; |
| 67 } | 75 } |
| 68 | 76 |
| 69 } // namespace net | 77 } // namespace net |
| OLD | NEW |