| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_BASE_MOCK_HOST_RESOLVER_H_ | 5 #ifndef NET_BASE_MOCK_HOST_RESOLVER_H_ |
| 6 #define NET_BASE_MOCK_HOST_RESOLVER_H_ | 6 #define NET_BASE_MOCK_HOST_RESOLVER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 void AllowDirectLookup(const std::string& host); | 160 void AllowDirectLookup(const std::string& host); |
| 161 | 161 |
| 162 // Simulate a lookup failure for |host| (it also can be a pattern). | 162 // Simulate a lookup failure for |host| (it also can be a pattern). |
| 163 void AddSimulatedFailure(const std::string& host); | 163 void AddSimulatedFailure(const std::string& host); |
| 164 | 164 |
| 165 // HostResolverProc methods: | 165 // HostResolverProc methods: |
| 166 virtual int Resolve(const std::string& host, | 166 virtual int Resolve(const std::string& host, |
| 167 AddressFamily address_family, | 167 AddressFamily address_family, |
| 168 HostResolverFlags host_resolver_flags, | 168 HostResolverFlags host_resolver_flags, |
| 169 AddressList* addrlist, | 169 AddressList* addrlist, |
| 170 int* os_error); | 170 int* os_error) OVERRIDE; |
| 171 | 171 |
| 172 private: | 172 private: |
| 173 struct Rule; | 173 struct Rule; |
| 174 typedef std::list<Rule> RuleList; | 174 typedef std::list<Rule> RuleList; |
| 175 | 175 |
| 176 virtual ~RuleBasedHostResolverProc(); | 176 virtual ~RuleBasedHostResolverProc(); |
| 177 | 177 |
| 178 RuleList rules_; | 178 RuleList rules_; |
| 179 }; | 179 }; |
| 180 | 180 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 void Init(HostResolverProc* proc); | 216 void Init(HostResolverProc* proc); |
| 217 | 217 |
| 218 private: | 218 private: |
| 219 scoped_refptr<HostResolverProc> current_proc_; | 219 scoped_refptr<HostResolverProc> current_proc_; |
| 220 scoped_refptr<HostResolverProc> previous_proc_; | 220 scoped_refptr<HostResolverProc> previous_proc_; |
| 221 }; | 221 }; |
| 222 | 222 |
| 223 } // namespace net | 223 } // namespace net |
| 224 | 224 |
| 225 #endif // NET_BASE_MOCK_HOST_RESOLVER_H_ | 225 #endif // NET_BASE_MOCK_HOST_RESOLVER_H_ |
| OLD | NEW |