| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 #include "net/base/auth.h" | 10 #include "net/base/auth.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 } | 158 } |
| 159 | 159 |
| 160 bool HttpProxyClientSocket::UsingTCPFastOpen() const { | 160 bool HttpProxyClientSocket::UsingTCPFastOpen() const { |
| 161 if (transport_.get() && transport_->socket()) { | 161 if (transport_.get() && transport_->socket()) { |
| 162 return transport_->socket()->UsingTCPFastOpen(); | 162 return transport_->socket()->UsingTCPFastOpen(); |
| 163 } | 163 } |
| 164 NOTREACHED(); | 164 NOTREACHED(); |
| 165 return false; | 165 return false; |
| 166 } | 166 } |
| 167 | 167 |
| 168 int64 HttpProxyClientSocket::NumBytesRead() const { |
| 169 if (transport_.get() && transport_->socket()) { |
| 170 return transport_->socket()->NumBytesRead(); |
| 171 } |
| 172 NOTREACHED(); |
| 173 return -1; |
| 174 } |
| 175 |
| 176 base::TimeDelta HttpProxyClientSocket::GetConnectTimeMicros() const { |
| 177 if (transport_.get() && transport_->socket()) { |
| 178 return transport_->socket()->GetConnectTimeMicros(); |
| 179 } |
| 180 NOTREACHED(); |
| 181 return base::TimeDelta::FromMicroseconds(-1); |
| 182 } |
| 183 |
| 168 int HttpProxyClientSocket::Read(IOBuffer* buf, int buf_len, | 184 int HttpProxyClientSocket::Read(IOBuffer* buf, int buf_len, |
| 169 CompletionCallback* callback) { | 185 CompletionCallback* callback) { |
| 170 DCHECK(!user_callback_); | 186 DCHECK(!user_callback_); |
| 171 if (next_state_ != STATE_DONE) { | 187 if (next_state_ != STATE_DONE) { |
| 172 // We're trying to read the body of the response but we're still trying | 188 // We're trying to read the body of the response but we're still trying |
| 173 // to establish an SSL tunnel through the proxy. We can't read these | 189 // to establish an SSL tunnel through the proxy. We can't read these |
| 174 // bytes when establishing a tunnel because they might be controlled by | 190 // bytes when establishing a tunnel because they might be controlled by |
| 175 // an active network attacker. We don't worry about this for HTTP | 191 // an active network attacker. We don't worry about this for HTTP |
| 176 // because an active network attacker can already control HTTP sessions. | 192 // because an active network attacker can already control HTTP sessions. |
| 177 // We reach this case when the user cancels a 407 proxy auth prompt. | 193 // We reach this case when the user cancels a 407 proxy auth prompt. |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 | 494 |
| 479 int HttpProxyClientSocket::DoTCPRestartComplete(int result) { | 495 int HttpProxyClientSocket::DoTCPRestartComplete(int result) { |
| 480 if (result != OK) | 496 if (result != OK) |
| 481 return result; | 497 return result; |
| 482 | 498 |
| 483 next_state_ = STATE_GENERATE_AUTH_TOKEN; | 499 next_state_ = STATE_GENERATE_AUTH_TOKEN; |
| 484 return result; | 500 return result; |
| 485 } | 501 } |
| 486 | 502 |
| 487 } // namespace net | 503 } // namespace net |
| OLD | NEW |