OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/socks5_client_socket.h" | 5 #include "net/socket/socks5_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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 } | 151 } |
152 | 152 |
153 base::TimeDelta SOCKS5ClientSocket::GetConnectTimeMicros() const { | 153 base::TimeDelta SOCKS5ClientSocket::GetConnectTimeMicros() const { |
154 if (transport_.get() && transport_->socket()) { | 154 if (transport_.get() && transport_->socket()) { |
155 return transport_->socket()->GetConnectTimeMicros(); | 155 return transport_->socket()->GetConnectTimeMicros(); |
156 } | 156 } |
157 NOTREACHED(); | 157 NOTREACHED(); |
158 return base::TimeDelta::FromMicroseconds(-1); | 158 return base::TimeDelta::FromMicroseconds(-1); |
159 } | 159 } |
160 | 160 |
| 161 bool SOCKS5ClientSocket::WasNpnNegotiated() const { |
| 162 if (transport_.get() && transport_->socket()) { |
| 163 return transport_->socket()->WasNpnNegotiated(); |
| 164 } |
| 165 NOTREACHED(); |
| 166 return false; |
| 167 } |
| 168 |
161 NextProto SOCKS5ClientSocket::GetNegotiatedProtocol() const { | 169 NextProto SOCKS5ClientSocket::GetNegotiatedProtocol() const { |
162 if (transport_.get() && transport_->socket()) { | 170 if (transport_.get() && transport_->socket()) { |
163 return transport_->socket()->GetNegotiatedProtocol(); | 171 return transport_->socket()->GetNegotiatedProtocol(); |
164 } | 172 } |
165 NOTREACHED(); | 173 NOTREACHED(); |
166 return kProtoUnknown; | 174 return kProtoUnknown; |
167 } | 175 } |
168 | 176 |
| 177 bool SOCKS5ClientSocket::GetSSLInfo(SSLInfo* ssl_info) { |
| 178 if (transport_.get() && transport_->socket()) { |
| 179 return transport_->socket()->GetSSLInfo(ssl_info); |
| 180 } |
| 181 NOTREACHED(); |
| 182 return false; |
| 183 |
| 184 } |
| 185 |
169 // Read is called by the transport layer above to read. This can only be done | 186 // Read is called by the transport layer above to read. This can only be done |
170 // if the SOCKS handshake is complete. | 187 // if the SOCKS handshake is complete. |
171 int SOCKS5ClientSocket::Read(IOBuffer* buf, int buf_len, | 188 int SOCKS5ClientSocket::Read(IOBuffer* buf, int buf_len, |
172 const CompletionCallback& callback) { | 189 const CompletionCallback& callback) { |
173 DCHECK(completed_handshake_); | 190 DCHECK(completed_handshake_); |
174 DCHECK_EQ(STATE_NONE, next_state_); | 191 DCHECK_EQ(STATE_NONE, next_state_); |
175 DCHECK(user_callback_.is_null()); | 192 DCHECK(user_callback_.is_null()); |
176 | 193 |
177 return transport_->socket()->Read(buf, buf_len, callback); | 194 return transport_->socket()->Read(buf, buf_len, callback); |
178 } | 195 } |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 | 512 |
496 int SOCKS5ClientSocket::GetPeerAddress(IPEndPoint* address) const { | 513 int SOCKS5ClientSocket::GetPeerAddress(IPEndPoint* address) const { |
497 return transport_->socket()->GetPeerAddress(address); | 514 return transport_->socket()->GetPeerAddress(address); |
498 } | 515 } |
499 | 516 |
500 int SOCKS5ClientSocket::GetLocalAddress(IPEndPoint* address) const { | 517 int SOCKS5ClientSocket::GetLocalAddress(IPEndPoint* address) const { |
501 return transport_->socket()->GetLocalAddress(address); | 518 return transport_->socket()->GetLocalAddress(address); |
502 } | 519 } |
503 | 520 |
504 } // namespace net | 521 } // namespace net |
OLD | NEW |