| 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/profiler/scoped_tracker.h" | 9 #include "base/profiler/scoped_tracker.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } | 206 } |
| 207 | 207 |
| 208 bool HttpProxyClientSocket::GetSSLInfo(SSLInfo* ssl_info) { | 208 bool HttpProxyClientSocket::GetSSLInfo(SSLInfo* ssl_info) { |
| 209 if (transport_.get() && transport_->socket()) { | 209 if (transport_.get() && transport_->socket()) { |
| 210 return transport_->socket()->GetSSLInfo(ssl_info); | 210 return transport_->socket()->GetSSLInfo(ssl_info); |
| 211 } | 211 } |
| 212 NOTREACHED(); | 212 NOTREACHED(); |
| 213 return false; | 213 return false; |
| 214 } | 214 } |
| 215 | 215 |
| 216 void HttpProxyClientSocket::GetConnectionAttempts( |
| 217 ConnectionAttempts* out) const { |
| 218 out->clear(); |
| 219 } |
| 220 |
| 216 int HttpProxyClientSocket::Read(IOBuffer* buf, int buf_len, | 221 int HttpProxyClientSocket::Read(IOBuffer* buf, int buf_len, |
| 217 const CompletionCallback& callback) { | 222 const CompletionCallback& callback) { |
| 218 DCHECK(user_callback_.is_null()); | 223 DCHECK(user_callback_.is_null()); |
| 219 if (next_state_ != STATE_DONE) { | 224 if (next_state_ != STATE_DONE) { |
| 220 // We're trying to read the body of the response but we're still trying | 225 // We're trying to read the body of the response but we're still trying |
| 221 // to establish an SSL tunnel through the proxy. We can't read these | 226 // to establish an SSL tunnel through the proxy. We can't read these |
| 222 // bytes when establishing a tunnel because they might be controlled by | 227 // bytes when establishing a tunnel because they might be controlled by |
| 223 // an active network attacker. We don't worry about this for HTTP | 228 // an active network attacker. We don't worry about this for HTTP |
| 224 // because an active network attacker can already control HTTP sessions. | 229 // because an active network attacker can already control HTTP sessions. |
| 225 // We reach this case when the user cancels a 407 proxy auth prompt. | 230 // We reach this case when the user cancels a 407 proxy auth prompt. |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 "462784 HttpProxyClientSocket::DoTCPRestartComplete")); | 560 "462784 HttpProxyClientSocket::DoTCPRestartComplete")); |
| 556 | 561 |
| 557 if (result != OK) | 562 if (result != OK) |
| 558 return result; | 563 return result; |
| 559 | 564 |
| 560 next_state_ = STATE_GENERATE_AUTH_TOKEN; | 565 next_state_ = STATE_GENERATE_AUTH_TOKEN; |
| 561 return result; | 566 return result; |
| 562 } | 567 } |
| 563 | 568 |
| 564 } // namespace net | 569 } // namespace net |
| OLD | NEW |