| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 29 matching lines...) Expand all Loading... |
| 40 public: | 40 public: |
| 41 // HostResolver methods: | 41 // HostResolver methods: |
| 42 virtual int Resolve(const RequestInfo& info, | 42 virtual int Resolve(const RequestInfo& info, |
| 43 AddressList* addresses, | 43 AddressList* addresses, |
| 44 CompletionCallback* callback, | 44 CompletionCallback* callback, |
| 45 RequestHandle* out_req, | 45 RequestHandle* out_req, |
| 46 LoadLog* load_log); | 46 LoadLog* load_log); |
| 47 virtual void CancelRequest(RequestHandle req); | 47 virtual void CancelRequest(RequestHandle req); |
| 48 virtual void AddObserver(Observer* observer); | 48 virtual void AddObserver(Observer* observer); |
| 49 virtual void RemoveObserver(Observer* observer); | 49 virtual void RemoveObserver(Observer* observer); |
| 50 // TODO(eroman): temp hack for http://crbug.com/18373 | |
| 51 virtual void Shutdown(); | |
| 52 | 50 |
| 53 RuleBasedHostResolverProc* rules() { return rules_; } | 51 RuleBasedHostResolverProc* rules() { return rules_; } |
| 54 | 52 |
| 55 // Controls whether resolutions complete synchronously or asynchronously. | 53 // Controls whether resolutions complete synchronously or asynchronously. |
| 56 void set_synchronous_mode(bool is_synchronous) { | 54 void set_synchronous_mode(bool is_synchronous) { |
| 57 synchronous_mode_ = is_synchronous; | 55 synchronous_mode_ = is_synchronous; |
| 58 } | 56 } |
| 59 | 57 |
| 60 // Resets the mock. | 58 // Resets the mock. |
| 61 void Reset(HostResolverProc* interceptor); | 59 void Reset(HostResolverProc* interceptor); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 void Init(HostResolverProc* proc); | 182 void Init(HostResolverProc* proc); |
| 185 | 183 |
| 186 private: | 184 private: |
| 187 scoped_refptr<HostResolverProc> current_proc_; | 185 scoped_refptr<HostResolverProc> current_proc_; |
| 188 scoped_refptr<HostResolverProc> previous_proc_; | 186 scoped_refptr<HostResolverProc> previous_proc_; |
| 189 }; | 187 }; |
| 190 | 188 |
| 191 } // namespace net | 189 } // namespace net |
| 192 | 190 |
| 193 #endif // NET_BASE_MOCK_HOST_RESOLVER_H_ | 191 #endif // NET_BASE_MOCK_HOST_RESOLVER_H_ |
| OLD | NEW |