| 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 void Shutdown() {} | |
| 107 | 106 |
| 108 bool HasOutstandingRequest() { | 107 bool HasOutstandingRequest() { |
| 109 return outstanding_request_ != NULL; | 108 return outstanding_request_ != NULL; |
| 110 } | 109 } |
| 111 | 110 |
| 112 private: | 111 private: |
| 113 RequestHandle outstanding_request_; | 112 RequestHandle outstanding_request_; |
| 114 | 113 |
| 115 DISALLOW_COPY_AND_ASSIGN(HangingHostResolver); | 114 DISALLOW_COPY_AND_ASSIGN(HangingHostResolver); |
| 116 }; | 115 }; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 // Disconnect the SOCKS socket -- this should cancel the outstanding resolve. | 370 // Disconnect the SOCKS socket -- this should cancel the outstanding resolve. |
| 372 user_sock_->Disconnect(); | 371 user_sock_->Disconnect(); |
| 373 | 372 |
| 374 EXPECT_FALSE(hanging_resolver->HasOutstandingRequest()); | 373 EXPECT_FALSE(hanging_resolver->HasOutstandingRequest()); |
| 375 | 374 |
| 376 EXPECT_FALSE(user_sock_->IsConnected()); | 375 EXPECT_FALSE(user_sock_->IsConnected()); |
| 377 EXPECT_FALSE(user_sock_->IsConnectedAndIdle()); | 376 EXPECT_FALSE(user_sock_->IsConnectedAndIdle()); |
| 378 } | 377 } |
| 379 | 378 |
| 380 } // namespace net | 379 } // namespace net |
| OLD | NEW |