OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // TODO(ukai): code is similar with http_network_transaction.cc. We should | 5 // TODO(ukai): code is similar with http_network_transaction.cc. We should |
6 // think about ways to share code, if possible. | 6 // think about ways to share code, if possible. |
7 | 7 |
8 #include "net/socket_stream/socket_stream.h" | 8 #include "net/socket_stream/socket_stream.h" |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 } | 769 } |
770 next_state_ = STATE_CLOSE; | 770 next_state_ = STATE_CLOSE; |
771 return ERR_TUNNEL_CONNECTION_FAILED; | 771 return ERR_TUNNEL_CONNECTION_FAILED; |
772 } | 772 } |
773 | 773 |
774 int SocketStream::DoSOCKSConnect() { | 774 int SocketStream::DoSOCKSConnect() { |
775 DCHECK_EQ(kSOCKSProxy, proxy_mode_); | 775 DCHECK_EQ(kSOCKSProxy, proxy_mode_); |
776 | 776 |
777 next_state_ = STATE_SOCKS_CONNECT_COMPLETE; | 777 next_state_ = STATE_SOCKS_CONNECT_COMPLETE; |
778 | 778 |
779 ClientSocket* s = socket_.release(); | 779 StreamSocket* s = socket_.release(); |
780 HostResolver::RequestInfo req_info(HostPortPair::FromURL(url_)); | 780 HostResolver::RequestInfo req_info(HostPortPair::FromURL(url_)); |
781 | 781 |
782 DCHECK(!proxy_info_.is_empty()); | 782 DCHECK(!proxy_info_.is_empty()); |
783 if (proxy_info_.proxy_server().scheme() == ProxyServer::SCHEME_SOCKS5) | 783 if (proxy_info_.proxy_server().scheme() == ProxyServer::SCHEME_SOCKS5) |
784 s = new SOCKS5ClientSocket(s, req_info); | 784 s = new SOCKS5ClientSocket(s, req_info); |
785 else | 785 else |
786 s = new SOCKSClientSocket(s, req_info, host_resolver_); | 786 s = new SOCKSClientSocket(s, req_info, host_resolver_); |
787 socket_.reset(s); | 787 socket_.reset(s); |
788 metrics_->OnSOCKSProxy(); | 788 metrics_->OnSOCKSProxy(); |
789 return socket_->Connect(&io_callback_); | 789 return socket_->Connect(&io_callback_); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 | 1029 |
1030 SSLConfigService* SocketStream::ssl_config_service() const { | 1030 SSLConfigService* SocketStream::ssl_config_service() const { |
1031 return context_->ssl_config_service(); | 1031 return context_->ssl_config_service(); |
1032 } | 1032 } |
1033 | 1033 |
1034 ProxyService* SocketStream::proxy_service() const { | 1034 ProxyService* SocketStream::proxy_service() const { |
1035 return context_->proxy_service(); | 1035 return context_->proxy_service(); |
1036 } | 1036 } |
1037 | 1037 |
1038 } // namespace net | 1038 } // namespace net |
OLD | NEW |