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/bind.h" | 8 #include "base/bind.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 } | 173 } |
174 | 174 |
175 base::TimeDelta SOCKSClientSocket::GetConnectTimeMicros() const { | 175 base::TimeDelta SOCKSClientSocket::GetConnectTimeMicros() const { |
176 if (transport_.get() && transport_->socket()) { | 176 if (transport_.get() && transport_->socket()) { |
177 return transport_->socket()->GetConnectTimeMicros(); | 177 return transport_->socket()->GetConnectTimeMicros(); |
178 } | 178 } |
179 NOTREACHED(); | 179 NOTREACHED(); |
180 return base::TimeDelta::FromMicroseconds(-1); | 180 return base::TimeDelta::FromMicroseconds(-1); |
181 } | 181 } |
182 | 182 |
183 NextProto SOCKSClientSocket::GetNegotiatedProtocol() const { | |
184 return kProtoUnknown; | |
wtc
2012/03/30 21:19:14
I wonder if we should call transport_->socket()->G
Ryan Hamilton
2012/03/30 21:53:17
Done.
| |
185 } | |
186 | |
183 // Read is called by the transport layer above to read. This can only be done | 187 // Read is called by the transport layer above to read. This can only be done |
184 // if the SOCKS handshake is complete. | 188 // if the SOCKS handshake is complete. |
185 int SOCKSClientSocket::Read(IOBuffer* buf, int buf_len, | 189 int SOCKSClientSocket::Read(IOBuffer* buf, int buf_len, |
186 const CompletionCallback& callback) { | 190 const CompletionCallback& callback) { |
187 DCHECK(completed_handshake_); | 191 DCHECK(completed_handshake_); |
188 DCHECK_EQ(STATE_NONE, next_state_); | 192 DCHECK_EQ(STATE_NONE, next_state_); |
189 DCHECK(user_callback_.is_null()); | 193 DCHECK(user_callback_.is_null()); |
190 | 194 |
191 return transport_->socket()->Read(buf, buf_len, callback); | 195 return transport_->socket()->Read(buf, buf_len, callback); |
192 } | 196 } |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
426 | 430 |
427 int SOCKSClientSocket::GetPeerAddress(AddressList* address) const { | 431 int SOCKSClientSocket::GetPeerAddress(AddressList* address) const { |
428 return transport_->socket()->GetPeerAddress(address); | 432 return transport_->socket()->GetPeerAddress(address); |
429 } | 433 } |
430 | 434 |
431 int SOCKSClientSocket::GetLocalAddress(IPEndPoint* address) const { | 435 int SOCKSClientSocket::GetLocalAddress(IPEndPoint* address) const { |
432 return transport_->socket()->GetLocalAddress(address); | 436 return transport_->socket()->GetLocalAddress(address); |
433 } | 437 } |
434 | 438 |
435 } // namespace net | 439 } // namespace net |
OLD | NEW |