| 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 #include "net/socket/socks_client_socket.h" | 5 #include "net/socket/socks_client_socket.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/trace_event.h" | 9 #include "base/trace_event.h" |
| 10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 } | 158 } |
| 159 | 159 |
| 160 bool SOCKSClientSocket::WasEverUsed() const { | 160 bool SOCKSClientSocket::WasEverUsed() const { |
| 161 if (transport_.get() && transport_->socket()) { | 161 if (transport_.get() && transport_->socket()) { |
| 162 return transport_->socket()->WasEverUsed(); | 162 return transport_->socket()->WasEverUsed(); |
| 163 } | 163 } |
| 164 NOTREACHED(); | 164 NOTREACHED(); |
| 165 return false; | 165 return false; |
| 166 } | 166 } |
| 167 | 167 |
| 168 bool SOCKSClientSocket::UsingTCPFastOpen() const { |
| 169 if (transport_.get() && transport_->socket()) { |
| 170 return transport_->socket()->UsingTCPFastOpen(); |
| 171 } |
| 172 NOTREACHED(); |
| 173 return false; |
| 174 } |
| 175 |
| 176 |
| 168 // Read is called by the transport layer above to read. This can only be done | 177 // Read is called by the transport layer above to read. This can only be done |
| 169 // if the SOCKS handshake is complete. | 178 // if the SOCKS handshake is complete. |
| 170 int SOCKSClientSocket::Read(IOBuffer* buf, int buf_len, | 179 int SOCKSClientSocket::Read(IOBuffer* buf, int buf_len, |
| 171 CompletionCallback* callback) { | 180 CompletionCallback* callback) { |
| 172 DCHECK(completed_handshake_); | 181 DCHECK(completed_handshake_); |
| 173 DCHECK_EQ(STATE_NONE, next_state_); | 182 DCHECK_EQ(STATE_NONE, next_state_); |
| 174 DCHECK(!user_callback_); | 183 DCHECK(!user_callback_); |
| 175 | 184 |
| 176 return transport_->socket()->Read(buf, buf_len, callback); | 185 return transport_->socket()->Read(buf, buf_len, callback); |
| 177 } | 186 } |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 } | 446 } |
| 438 | 447 |
| 439 // Note: we ignore the last 6 bytes as specified by the SOCKS protocol | 448 // Note: we ignore the last 6 bytes as specified by the SOCKS protocol |
| 440 } | 449 } |
| 441 | 450 |
| 442 int SOCKSClientSocket::GetPeerAddress(AddressList* address) const { | 451 int SOCKSClientSocket::GetPeerAddress(AddressList* address) const { |
| 443 return transport_->socket()->GetPeerAddress(address); | 452 return transport_->socket()->GetPeerAddress(address); |
| 444 } | 453 } |
| 445 | 454 |
| 446 } // namespace net | 455 } // namespace net |
| OLD | NEW |