| 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 16 matching lines...) Expand all Loading... |
| 27 HttpProxyClientSocket::HttpProxyClientSocket( | 27 HttpProxyClientSocket::HttpProxyClientSocket( |
| 28 ClientSocketHandle* transport_socket, | 28 ClientSocketHandle* transport_socket, |
| 29 const GURL& request_url, | 29 const GURL& request_url, |
| 30 const std::string& user_agent, | 30 const std::string& user_agent, |
| 31 const HostPortPair& endpoint, | 31 const HostPortPair& endpoint, |
| 32 const HostPortPair& proxy_server, | 32 const HostPortPair& proxy_server, |
| 33 HttpAuthCache* http_auth_cache, | 33 HttpAuthCache* http_auth_cache, |
| 34 HttpAuthHandlerFactory* http_auth_handler_factory, | 34 HttpAuthHandlerFactory* http_auth_handler_factory, |
| 35 bool tunnel, | 35 bool tunnel, |
| 36 bool using_spdy, | 36 bool using_spdy, |
| 37 SSLClientSocket::NextProto protocol_negotiated, | 37 NextProto protocol_negotiated, |
| 38 bool is_https_proxy) | 38 bool is_https_proxy) |
| 39 : ALLOW_THIS_IN_INITIALIZER_LIST(io_callback_( | 39 : ALLOW_THIS_IN_INITIALIZER_LIST(io_callback_( |
| 40 base::Bind(&HttpProxyClientSocket::OnIOComplete, | 40 base::Bind(&HttpProxyClientSocket::OnIOComplete, |
| 41 base::Unretained(this)))), | 41 base::Unretained(this)))), |
| 42 next_state_(STATE_NONE), | 42 next_state_(STATE_NONE), |
| 43 transport_(transport_socket), | 43 transport_(transport_socket), |
| 44 endpoint_(endpoint), | 44 endpoint_(endpoint), |
| 45 auth_(tunnel ? | 45 auth_(tunnel ? |
| 46 new HttpAuthController(HttpAuth::AUTH_PROXY, | 46 new HttpAuthController(HttpAuth::AUTH_PROXY, |
| 47 GURL((is_https_proxy ? "https://" : "http://") | 47 GURL((is_https_proxy ? "https://" : "http://") |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 const scoped_refptr<HttpAuthController>& | 86 const scoped_refptr<HttpAuthController>& |
| 87 HttpProxyClientSocket::GetAuthController() const { | 87 HttpProxyClientSocket::GetAuthController() const { |
| 88 return auth_; | 88 return auth_; |
| 89 } | 89 } |
| 90 | 90 |
| 91 bool HttpProxyClientSocket::IsUsingSpdy() const { | 91 bool HttpProxyClientSocket::IsUsingSpdy() const { |
| 92 return using_spdy_; | 92 return using_spdy_; |
| 93 } | 93 } |
| 94 | 94 |
| 95 SSLClientSocket::NextProto | 95 NextProto HttpProxyClientSocket::GetProtocolNegotiated() const { |
| 96 HttpProxyClientSocket::GetProtocolNegotiated() const { | |
| 97 return protocol_negotiated_; | 96 return protocol_negotiated_; |
| 98 } | 97 } |
| 99 | 98 |
| 100 const HttpResponseInfo* HttpProxyClientSocket::GetConnectResponseInfo() const { | 99 const HttpResponseInfo* HttpProxyClientSocket::GetConnectResponseInfo() const { |
| 101 return response_.headers ? &response_ : NULL; | 100 return response_.headers ? &response_ : NULL; |
| 102 } | 101 } |
| 103 | 102 |
| 104 HttpStream* HttpProxyClientSocket::CreateConnectResponseStream() { | 103 HttpStream* HttpProxyClientSocket::CreateConnectResponseStream() { |
| 105 return new HttpBasicStream(transport_.release(), | 104 return new HttpBasicStream(transport_.release(), |
| 106 http_stream_parser_.release(), false); | 105 http_stream_parser_.release(), false); |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 | 504 |
| 506 int HttpProxyClientSocket::DoTCPRestartComplete(int result) { | 505 int HttpProxyClientSocket::DoTCPRestartComplete(int result) { |
| 507 if (result != OK) | 506 if (result != OK) |
| 508 return result; | 507 return result; |
| 509 | 508 |
| 510 next_state_ = STATE_GENERATE_AUTH_TOKEN; | 509 next_state_ = STATE_GENERATE_AUTH_TOKEN; |
| 511 return result; | 510 return result; |
| 512 } | 511 } |
| 513 | 512 |
| 514 } // namespace net | 513 } // namespace net |
| OLD | NEW |