| 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 28 matching lines...) Expand all Loading... |
| 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(const RequestInfo& info, AddressList* addresses, |
| 45 CompletionCallback* callback, RequestHandle* out_req); | 45 CompletionCallback* callback, RequestHandle* out_req); |
| 46 virtual void CancelRequest(RequestHandle req); | 46 virtual void CancelRequest(RequestHandle req); |
| 47 virtual void AddObserver(Observer* observer); | 47 virtual void AddObserver(Observer* observer); |
| 48 virtual void RemoveObserver(Observer* observer); | 48 virtual void RemoveObserver(Observer* observer); |
| 49 // TODO(eroman): temp hack for http://crbug.com/15513 | 49 // TODO(eroman): temp hack for http://crbug.com/18373 |
| 50 virtual void Shutdown(); | 50 virtual void Shutdown(); |
| 51 | 51 |
| 52 RuleBasedHostResolverProc* rules() { return rules_; } | 52 RuleBasedHostResolverProc* rules() { return rules_; } |
| 53 | 53 |
| 54 // Controls whether resolutions complete synchronously or asynchronously. | 54 // Controls whether resolutions complete synchronously or asynchronously. |
| 55 void set_synchronous_mode(bool is_synchronous) { | 55 void set_synchronous_mode(bool is_synchronous) { |
| 56 synchronous_mode_ = is_synchronous; | 56 synchronous_mode_ = is_synchronous; |
| 57 } | 57 } |
| 58 | 58 |
| 59 // Resets the mock. | 59 // Resets the mock. |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 void Init(HostResolverProc* proc); | 162 void Init(HostResolverProc* proc); |
| 163 | 163 |
| 164 private: | 164 private: |
| 165 scoped_refptr<HostResolverProc> current_proc_; | 165 scoped_refptr<HostResolverProc> current_proc_; |
| 166 scoped_refptr<HostResolverProc> previous_proc_; | 166 scoped_refptr<HostResolverProc> previous_proc_; |
| 167 }; | 167 }; |
| 168 | 168 |
| 169 } // namespace net | 169 } // namespace net |
| 170 | 170 |
| 171 #endif // NET_BASE_MOCK_HOST_RESOLVER_H_ | 171 #endif // NET_BASE_MOCK_HOST_RESOLVER_H_ |
| OLD | NEW |