| 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 #include "net/socket/socks_client_socket.h" | 5 #include "net/socket/socks_client_socket.h" |
| 6 | 6 |
| 7 #include "net/base/address_list.h" | 7 #include "net/base/address_list.h" |
| 8 #include "net/base/load_log.h" | 8 #include "net/base/load_log.h" |
| 9 #include "net/base/load_log_unittest.h" | 9 #include "net/base/load_log_unittest.h" |
| 10 #include "net/base/mock_host_resolver.h" | 10 #include "net/base/mock_host_resolver.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 96 } |
| 97 | 97 |
| 98 virtual void CancelRequest(RequestHandle req) { | 98 virtual void CancelRequest(RequestHandle req) { |
| 99 EXPECT_TRUE(HasOutstandingRequest()); | 99 EXPECT_TRUE(HasOutstandingRequest()); |
| 100 EXPECT_EQ(outstanding_request_, req); | 100 EXPECT_EQ(outstanding_request_, req); |
| 101 outstanding_request_ = NULL; | 101 outstanding_request_ = NULL; |
| 102 } | 102 } |
| 103 | 103 |
| 104 virtual void AddObserver(Observer* observer) {} | 104 virtual void AddObserver(Observer* observer) {} |
| 105 virtual void RemoveObserver(Observer* observer) {} | 105 virtual void RemoveObserver(Observer* observer) {} |
| 106 virtual HostCache* GetHostCache() { return NULL; } | |
| 107 virtual void Shutdown() {} | 106 virtual void Shutdown() {} |
| 108 | 107 |
| 109 bool HasOutstandingRequest() { | 108 bool HasOutstandingRequest() { |
| 110 return outstanding_request_ != NULL; | 109 return outstanding_request_ != NULL; |
| 111 } | 110 } |
| 112 | 111 |
| 113 private: | 112 private: |
| 114 RequestHandle outstanding_request_; | 113 RequestHandle outstanding_request_; |
| 115 | 114 |
| 116 DISALLOW_COPY_AND_ASSIGN(HangingHostResolver); | 115 DISALLOW_COPY_AND_ASSIGN(HangingHostResolver); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 // Disconnect the SOCKS socket -- this should cancel the outstanding resolve. | 371 // Disconnect the SOCKS socket -- this should cancel the outstanding resolve. |
| 373 user_sock_->Disconnect(); | 372 user_sock_->Disconnect(); |
| 374 | 373 |
| 375 EXPECT_FALSE(hanging_resolver->HasOutstandingRequest()); | 374 EXPECT_FALSE(hanging_resolver->HasOutstandingRequest()); |
| 376 | 375 |
| 377 EXPECT_FALSE(user_sock_->IsConnected()); | 376 EXPECT_FALSE(user_sock_->IsConnected()); |
| 378 EXPECT_FALSE(user_sock_->IsConnectedAndIdle()); | 377 EXPECT_FALSE(user_sock_->IsConnectedAndIdle()); |
| 379 } | 378 } |
| 380 | 379 |
| 381 } // namespace net | 380 } // namespace net |
| OLD | NEW |