| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 } | 194 } |
| 195 | 195 |
| 196 base::TimeDelta HttpProxyClientSocket::GetConnectTimeMicros() const { | 196 base::TimeDelta HttpProxyClientSocket::GetConnectTimeMicros() const { |
| 197 if (transport_.get() && transport_->socket()) { | 197 if (transport_.get() && transport_->socket()) { |
| 198 return transport_->socket()->GetConnectTimeMicros(); | 198 return transport_->socket()->GetConnectTimeMicros(); |
| 199 } | 199 } |
| 200 NOTREACHED(); | 200 NOTREACHED(); |
| 201 return base::TimeDelta::FromMicroseconds(-1); | 201 return base::TimeDelta::FromMicroseconds(-1); |
| 202 } | 202 } |
| 203 | 203 |
| 204 NextProto HttpProxyClientSocket::GetNegotiatedProtocol() const { |
| 205 if (transport_.get() && transport_->socket()) { |
| 206 return transport_->socket()->GetNegotiatedProtocol(); |
| 207 } |
| 208 NOTREACHED(); |
| 209 return kProtoUnknown; |
| 210 } |
| 211 |
| 204 int HttpProxyClientSocket::Read(IOBuffer* buf, int buf_len, | 212 int HttpProxyClientSocket::Read(IOBuffer* buf, int buf_len, |
| 205 const CompletionCallback& callback) { | 213 const CompletionCallback& callback) { |
| 206 DCHECK(user_callback_.is_null()); | 214 DCHECK(user_callback_.is_null()); |
| 207 if (next_state_ != STATE_DONE) { | 215 if (next_state_ != STATE_DONE) { |
| 208 // We're trying to read the body of the response but we're still trying | 216 // We're trying to read the body of the response but we're still trying |
| 209 // to establish an SSL tunnel through the proxy. We can't read these | 217 // to establish an SSL tunnel through the proxy. We can't read these |
| 210 // bytes when establishing a tunnel because they might be controlled by | 218 // bytes when establishing a tunnel because they might be controlled by |
| 211 // an active network attacker. We don't worry about this for HTTP | 219 // an active network attacker. We don't worry about this for HTTP |
| 212 // because an active network attacker can already control HTTP sessions. | 220 // because an active network attacker can already control HTTP sessions. |
| 213 // We reach this case when the user cancels a 407 proxy auth prompt. | 221 // We reach this case when the user cancels a 407 proxy auth prompt. |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 | 512 |
| 505 int HttpProxyClientSocket::DoTCPRestartComplete(int result) { | 513 int HttpProxyClientSocket::DoTCPRestartComplete(int result) { |
| 506 if (result != OK) | 514 if (result != OK) |
| 507 return result; | 515 return result; |
| 508 | 516 |
| 509 next_state_ = STATE_GENERATE_AUTH_TOKEN; | 517 next_state_ = STATE_GENERATE_AUTH_TOKEN; |
| 510 return result; | 518 return result; |
| 511 } | 519 } |
| 512 | 520 |
| 513 } // namespace net | 521 } // namespace net |
| OLD | NEW |