| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/base/io_buffer.h" | 9 #include "net/base/io_buffer.h" |
| 10 #include "net/base/net_log.h" | 10 #include "net/base/net_log.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 162 } |
| 163 | 163 |
| 164 bool SOCKSClientSocket::UsingTCPFastOpen() const { | 164 bool SOCKSClientSocket::UsingTCPFastOpen() const { |
| 165 if (transport_.get() && transport_->socket()) { | 165 if (transport_.get() && transport_->socket()) { |
| 166 return transport_->socket()->UsingTCPFastOpen(); | 166 return transport_->socket()->UsingTCPFastOpen(); |
| 167 } | 167 } |
| 168 NOTREACHED(); | 168 NOTREACHED(); |
| 169 return false; | 169 return false; |
| 170 } | 170 } |
| 171 | 171 |
| 172 int64 SOCKSClientSocket::NumBytesRead() const { |
| 173 if (transport_.get() && transport_->socket()) { |
| 174 return transport_->socket()->NumBytesRead(); |
| 175 } |
| 176 NOTREACHED(); |
| 177 return -1; |
| 178 } |
| 179 |
| 180 int SOCKSClientSocket::GetConnectTimeMicros() const { |
| 181 if (transport_.get() && transport_->socket()) { |
| 182 return transport_->socket()->GetConnectTimeMicros(); |
| 183 } |
| 184 NOTREACHED(); |
| 185 return -1; |
| 186 } |
| 187 |
| 172 | 188 |
| 173 // Read is called by the transport layer above to read. This can only be done | 189 // Read is called by the transport layer above to read. This can only be done |
| 174 // if the SOCKS handshake is complete. | 190 // if the SOCKS handshake is complete. |
| 175 int SOCKSClientSocket::Read(IOBuffer* buf, int buf_len, | 191 int SOCKSClientSocket::Read(IOBuffer* buf, int buf_len, |
| 176 CompletionCallback* callback) { | 192 CompletionCallback* callback) { |
| 177 DCHECK(completed_handshake_); | 193 DCHECK(completed_handshake_); |
| 178 DCHECK_EQ(STATE_NONE, next_state_); | 194 DCHECK_EQ(STATE_NONE, next_state_); |
| 179 DCHECK(!user_callback_); | 195 DCHECK(!user_callback_); |
| 180 | 196 |
| 181 return transport_->socket()->Read(buf, buf_len, callback); | 197 return transport_->socket()->Read(buf, buf_len, callback); |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 | 428 |
| 413 int SOCKSClientSocket::GetPeerAddress(AddressList* address) const { | 429 int SOCKSClientSocket::GetPeerAddress(AddressList* address) const { |
| 414 return transport_->socket()->GetPeerAddress(address); | 430 return transport_->socket()->GetPeerAddress(address); |
| 415 } | 431 } |
| 416 | 432 |
| 417 int SOCKSClientSocket::GetLocalAddress(IPEndPoint* address) const { | 433 int SOCKSClientSocket::GetLocalAddress(IPEndPoint* address) const { |
| 418 return transport_->socket()->GetLocalAddress(address); | 434 return transport_->socket()->GetLocalAddress(address); |
| 419 } | 435 } |
| 420 | 436 |
| 421 } // namespace net | 437 } // namespace net |
| OLD | NEW |