| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 result = DidEstablishConnection(); | 790 result = DidEstablishConnection(); |
| 791 } else { | 791 } else { |
| 792 next_state_ = STATE_CLOSE; | 792 next_state_ = STATE_CLOSE; |
| 793 } | 793 } |
| 794 return result; | 794 return result; |
| 795 } | 795 } |
| 796 | 796 |
| 797 int SocketStream::DoSSLConnect() { | 797 int SocketStream::DoSSLConnect() { |
| 798 DCHECK(factory_); | 798 DCHECK(factory_); |
| 799 socket_.reset(factory_->CreateSSLClientSocket( | 799 socket_.reset(factory_->CreateSSLClientSocket( |
| 800 socket_.release(), url_.HostNoBrackets(), ssl_config_)); | 800 socket_.release(), |
| 801 HostPortPair(url_.HostNoBrackets(), url_.EffectiveIntPort()), |
| 802 ssl_config_)); |
| 801 next_state_ = STATE_SSL_CONNECT_COMPLETE; | 803 next_state_ = STATE_SSL_CONNECT_COMPLETE; |
| 802 metrics_->OnSSLConnection(); | 804 metrics_->OnSSLConnection(); |
| 803 return socket_->Connect(&io_callback_); | 805 return socket_->Connect(&io_callback_); |
| 804 } | 806 } |
| 805 | 807 |
| 806 int SocketStream::DoSSLConnectComplete(int result) { | 808 int SocketStream::DoSSLConnectComplete(int result) { |
| 807 if (IsCertificateError(result)) { | 809 if (IsCertificateError(result)) { |
| 808 if (socket_->IsConnectedAndIdle()) { | 810 if (socket_->IsConnectedAndIdle()) { |
| 809 result = HandleCertificateError(result); | 811 result = HandleCertificateError(result); |
| 810 } else { | 812 } else { |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 | 1021 |
| 1020 SSLConfigService* SocketStream::ssl_config_service() const { | 1022 SSLConfigService* SocketStream::ssl_config_service() const { |
| 1021 return context_->ssl_config_service(); | 1023 return context_->ssl_config_service(); |
| 1022 } | 1024 } |
| 1023 | 1025 |
| 1024 ProxyService* SocketStream::proxy_service() const { | 1026 ProxyService* SocketStream::proxy_service() const { |
| 1025 return context_->proxy_service(); | 1027 return context_->proxy_service(); |
| 1026 } | 1028 } |
| 1027 | 1029 |
| 1028 } // namespace net | 1030 } // namespace net |
| OLD | NEW |