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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 int SocketStream::DoSOCKSConnect() { | 681 int SocketStream::DoSOCKSConnect() { |
682 DCHECK_EQ(kSOCKSProxy, proxy_mode_); | 682 DCHECK_EQ(kSOCKSProxy, proxy_mode_); |
683 | 683 |
684 next_state_ = STATE_SOCKS_CONNECT_COMPLETE; | 684 next_state_ = STATE_SOCKS_CONNECT_COMPLETE; |
685 | 685 |
686 ClientSocket* s = socket_.release(); | 686 ClientSocket* s = socket_.release(); |
687 HostResolver::RequestInfo req_info(url_.HostNoBrackets(), | 687 HostResolver::RequestInfo req_info(url_.HostNoBrackets(), |
688 url_.EffectiveIntPort()); | 688 url_.EffectiveIntPort()); |
689 | 689 |
690 if (proxy_info_.proxy_server().scheme() == ProxyServer::SCHEME_SOCKS5) | 690 if (proxy_info_.proxy_server().scheme() == ProxyServer::SCHEME_SOCKS5) |
691 s = new SOCKS5ClientSocket(s, req_info, host_resolver_.get()); | 691 s = new SOCKS5ClientSocket(s, req_info); |
692 else | 692 else |
693 s = new SOCKSClientSocket(s, req_info, host_resolver_.get()); | 693 s = new SOCKSClientSocket(s, req_info, host_resolver_.get()); |
694 socket_.reset(s); | 694 socket_.reset(s); |
695 metrics_->OnSOCKSProxy(); | 695 metrics_->OnSOCKSProxy(); |
696 return socket_->Connect(&io_callback_, load_log_); | 696 return socket_->Connect(&io_callback_, load_log_); |
697 } | 697 } |
698 | 698 |
699 int SocketStream::DoSOCKSConnectComplete(int result) { | 699 int SocketStream::DoSOCKSConnectComplete(int result) { |
700 DCHECK_EQ(kSOCKSProxy, proxy_mode_); | 700 DCHECK_EQ(kSOCKSProxy, proxy_mode_); |
701 | 701 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 return context_->proxy_service(); | 886 return context_->proxy_service(); |
887 } | 887 } |
888 | 888 |
889 void SocketStream::GetInfoForTracker( | 889 void SocketStream::GetInfoForTracker( |
890 RequestTracker<SocketStream>::RecentRequestInfo* info) const { | 890 RequestTracker<SocketStream>::RecentRequestInfo* info) const { |
891 info->original_url = url_; | 891 info->original_url = url_; |
892 info->load_log = load_log_; | 892 info->load_log = load_log_; |
893 } | 893 } |
894 | 894 |
895 } // namespace net | 895 } // namespace net |
OLD | NEW |