OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <string> | 10 #include <string> |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 int SocketStream::DoSOCKSConnect() { | 697 int SocketStream::DoSOCKSConnect() { |
698 DCHECK_EQ(kSOCKSProxy, proxy_mode_); | 698 DCHECK_EQ(kSOCKSProxy, proxy_mode_); |
699 | 699 |
700 next_state_ = STATE_SOCKS_CONNECT_COMPLETE; | 700 next_state_ = STATE_SOCKS_CONNECT_COMPLETE; |
701 | 701 |
702 ClientSocket* s = socket_.release(); | 702 ClientSocket* s = socket_.release(); |
703 HostResolver::RequestInfo req_info(url_.HostNoBrackets(), | 703 HostResolver::RequestInfo req_info(url_.HostNoBrackets(), |
704 url_.EffectiveIntPort()); | 704 url_.EffectiveIntPort()); |
705 | 705 |
706 if (proxy_info_.proxy_server().scheme() == ProxyServer::SCHEME_SOCKS5) | 706 if (proxy_info_.proxy_server().scheme() == ProxyServer::SCHEME_SOCKS5) |
707 s = new SOCKS5ClientSocket(s, req_info, NULL /*use proxy-side resolving*/); | 707 s = new SOCKS5ClientSocket(s, req_info); |
708 else | 708 else |
709 s = new SOCKSClientSocket(s, req_info, host_resolver_.get()); | 709 s = new SOCKSClientSocket(s, req_info, host_resolver_.get()); |
710 socket_.reset(s); | 710 socket_.reset(s); |
711 metrics_->OnSOCKSProxy(); | 711 metrics_->OnSOCKSProxy(); |
712 return socket_->Connect(&io_callback_, load_log_); | 712 return socket_->Connect(&io_callback_, load_log_); |
713 } | 713 } |
714 | 714 |
715 int SocketStream::DoSOCKSConnectComplete(int result) { | 715 int SocketStream::DoSOCKSConnectComplete(int result) { |
716 DCHECK_EQ(kSOCKSProxy, proxy_mode_); | 716 DCHECK_EQ(kSOCKSProxy, proxy_mode_); |
717 | 717 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 return context_->proxy_service(); | 902 return context_->proxy_service(); |
903 } | 903 } |
904 | 904 |
905 void SocketStream::GetInfoForTracker( | 905 void SocketStream::GetInfoForTracker( |
906 RequestTracker<SocketStream>::RecentRequestInfo* info) const { | 906 RequestTracker<SocketStream>::RecentRequestInfo* info) const { |
907 info->original_url = url_; | 907 info->original_url = url_; |
908 info->load_log = load_log_; | 908 info->load_log = load_log_; |
909 } | 909 } |
910 | 910 |
911 } // namespace net | 911 } // namespace net |
OLD | NEW |