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/http/http_proxy_client_socket.h" | 5 #include "net/http/http_proxy_client_socket.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 } | 193 } |
194 | 194 |
195 base::TimeDelta HttpProxyClientSocket::GetConnectTimeMicros() const { | 195 base::TimeDelta HttpProxyClientSocket::GetConnectTimeMicros() const { |
196 if (transport_.get() && transport_->socket()) { | 196 if (transport_.get() && transport_->socket()) { |
197 return transport_->socket()->GetConnectTimeMicros(); | 197 return transport_->socket()->GetConnectTimeMicros(); |
198 } | 198 } |
199 NOTREACHED(); | 199 NOTREACHED(); |
200 return base::TimeDelta::FromMicroseconds(-1); | 200 return base::TimeDelta::FromMicroseconds(-1); |
201 } | 201 } |
202 | 202 |
| 203 bool HttpProxyClientSocket::WasNpnNegotiated() const { |
| 204 if (transport_.get() && transport_->socket()) { |
| 205 return transport_->socket()->WasNpnNegotiated(); |
| 206 } |
| 207 NOTREACHED(); |
| 208 return false; |
| 209 } |
| 210 |
203 NextProto HttpProxyClientSocket::GetNegotiatedProtocol() const { | 211 NextProto HttpProxyClientSocket::GetNegotiatedProtocol() const { |
204 if (transport_.get() && transport_->socket()) { | 212 if (transport_.get() && transport_->socket()) { |
205 return transport_->socket()->GetNegotiatedProtocol(); | 213 return transport_->socket()->GetNegotiatedProtocol(); |
206 } | 214 } |
207 NOTREACHED(); | 215 NOTREACHED(); |
208 return kProtoUnknown; | 216 return kProtoUnknown; |
209 } | 217 } |
210 | 218 |
| 219 bool HttpProxyClientSocket::GetSSLInfo(SSLInfo* ssl_info) { |
| 220 if (transport_.get() && transport_->socket()) { |
| 221 return transport_->socket()->GetSSLInfo(ssl_info); |
| 222 } |
| 223 NOTREACHED(); |
| 224 return false; |
| 225 } |
| 226 |
211 int HttpProxyClientSocket::Read(IOBuffer* buf, int buf_len, | 227 int HttpProxyClientSocket::Read(IOBuffer* buf, int buf_len, |
212 const CompletionCallback& callback) { | 228 const CompletionCallback& callback) { |
213 DCHECK(user_callback_.is_null()); | 229 DCHECK(user_callback_.is_null()); |
214 if (next_state_ != STATE_DONE) { | 230 if (next_state_ != STATE_DONE) { |
215 // We're trying to read the body of the response but we're still trying | 231 // We're trying to read the body of the response but we're still trying |
216 // to establish an SSL tunnel through the proxy. We can't read these | 232 // to establish an SSL tunnel through the proxy. We can't read these |
217 // bytes when establishing a tunnel because they might be controlled by | 233 // bytes when establishing a tunnel because they might be controlled by |
218 // an active network attacker. We don't worry about this for HTTP | 234 // an active network attacker. We don't worry about this for HTTP |
219 // because an active network attacker can already control HTTP sessions. | 235 // because an active network attacker can already control HTTP sessions. |
220 // We reach this case when the user cancels a 407 proxy auth prompt. | 236 // We reach this case when the user cancels a 407 proxy auth prompt. |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 | 526 |
511 int HttpProxyClientSocket::DoTCPRestartComplete(int result) { | 527 int HttpProxyClientSocket::DoTCPRestartComplete(int result) { |
512 if (result != OK) | 528 if (result != OK) |
513 return result; | 529 return result; |
514 | 530 |
515 next_state_ = STATE_GENERATE_AUTH_TOKEN; | 531 next_state_ = STATE_GENERATE_AUTH_TOKEN; |
516 return result; | 532 return result; |
517 } | 533 } |
518 | 534 |
519 } // namespace net | 535 } // namespace net |
OLD | NEW |