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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 if (proxy_mode_ != kDirectConnection) { | 601 if (proxy_mode_ != kDirectConnection) { |
602 host_port_pair = proxy_info_.proxy_server().host_port_pair(); | 602 host_port_pair = proxy_info_.proxy_server().host_port_pair(); |
603 } else { | 603 } else { |
604 host_port_pair = HostPortPair::FromURL(url_); | 604 host_port_pair = HostPortPair::FromURL(url_); |
605 } | 605 } |
606 | 606 |
607 HostResolver::RequestInfo resolve_info(host_port_pair); | 607 HostResolver::RequestInfo resolve_info(host_port_pair); |
608 | 608 |
609 DCHECK(host_resolver_); | 609 DCHECK(host_resolver_); |
610 resolver_.reset(new SingleRequestHostResolver(host_resolver_)); | 610 resolver_.reset(new SingleRequestHostResolver(host_resolver_)); |
611 return resolver_->Resolve(resolve_info, &addresses_, &io_callback_, | 611 return resolver_->Resolve( |
612 net_log_); | 612 resolve_info, &addresses_, base::Bind(&SocketStream::OnIOCompleted, this), |
| 613 net_log_); |
613 } | 614 } |
614 | 615 |
615 int SocketStream::DoResolveHostComplete(int result) { | 616 int SocketStream::DoResolveHostComplete(int result) { |
616 if (result == OK && delegate_) | 617 if (result == OK && delegate_) |
617 next_state_ = STATE_RESOLVE_PROTOCOL; | 618 next_state_ = STATE_RESOLVE_PROTOCOL; |
618 else | 619 else |
619 next_state_ = STATE_CLOSE; | 620 next_state_ = STATE_CLOSE; |
620 // TODO(ukai): if error occured, reconsider proxy after error. | 621 // TODO(ukai): if error occured, reconsider proxy after error. |
621 return result; | 622 return result; |
622 } | 623 } |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 | 1181 |
1181 SSLConfigService* SocketStream::ssl_config_service() const { | 1182 SSLConfigService* SocketStream::ssl_config_service() const { |
1182 return context_->ssl_config_service(); | 1183 return context_->ssl_config_service(); |
1183 } | 1184 } |
1184 | 1185 |
1185 ProxyService* SocketStream::proxy_service() const { | 1186 ProxyService* SocketStream::proxy_service() const { |
1186 return context_->proxy_service(); | 1187 return context_->proxy_service(); |
1187 } | 1188 } |
1188 | 1189 |
1189 } // namespace net | 1190 } // namespace net |
OLD | NEW |