| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/waitable_event.h" | 10 #include "base/waitable_event.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // | 34 // |
| 35 // Replacement doesn't have to be string representing an IP address. It can | 35 // Replacement doesn't have to be string representing an IP address. It can |
| 36 // re-map one hostname to another as well. | 36 // re-map one hostname to another as well. |
| 37 | 37 |
| 38 // Base class shared by MockHostResolver and MockCachingHostResolver. | 38 // Base class shared by MockHostResolver and MockCachingHostResolver. |
| 39 class MockHostResolverBase : public HostResolver { | 39 class MockHostResolverBase : public HostResolver { |
| 40 public: | 40 public: |
| 41 virtual ~MockHostResolverBase() {} | 41 virtual ~MockHostResolverBase() {} |
| 42 | 42 |
| 43 // HostResolver methods: | 43 // HostResolver methods: |
| 44 virtual int Resolve(const RequestInfo& info, AddressList* addresses, | 44 virtual int Resolve(LoadLog* load_log, |
| 45 CompletionCallback* callback, RequestHandle* out_req); | 45 const RequestInfo& info, |
| 46 AddressList* addresses, |
| 47 CompletionCallback* callback, |
| 48 RequestHandle* out_req); |
| 46 virtual void CancelRequest(RequestHandle req); | 49 virtual void CancelRequest(RequestHandle req); |
| 47 virtual void AddObserver(Observer* observer); | 50 virtual void AddObserver(Observer* observer); |
| 48 virtual void RemoveObserver(Observer* observer); | 51 virtual void RemoveObserver(Observer* observer); |
| 49 // TODO(eroman): temp hack for http://crbug.com/18373 | 52 // TODO(eroman): temp hack for http://crbug.com/18373 |
| 50 virtual void Shutdown(); | 53 virtual void Shutdown(); |
| 51 | 54 |
| 52 RuleBasedHostResolverProc* rules() { return rules_; } | 55 RuleBasedHostResolverProc* rules() { return rules_; } |
| 53 | 56 |
| 54 // Controls whether resolutions complete synchronously or asynchronously. | 57 // Controls whether resolutions complete synchronously or asynchronously. |
| 55 void set_synchronous_mode(bool is_synchronous) { | 58 void set_synchronous_mode(bool is_synchronous) { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 void Init(HostResolverProc* proc); | 165 void Init(HostResolverProc* proc); |
| 163 | 166 |
| 164 private: | 167 private: |
| 165 scoped_refptr<HostResolverProc> current_proc_; | 168 scoped_refptr<HostResolverProc> current_proc_; |
| 166 scoped_refptr<HostResolverProc> previous_proc_; | 169 scoped_refptr<HostResolverProc> previous_proc_; |
| 167 }; | 170 }; |
| 168 | 171 |
| 169 } // namespace net | 172 } // namespace net |
| 170 | 173 |
| 171 #endif // NET_BASE_MOCK_HOST_RESOLVER_H_ | 174 #endif // NET_BASE_MOCK_HOST_RESOLVER_H_ |
| OLD | NEW |