| 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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 else | 786 else |
| 787 result = DidEstablishConnection(); | 787 result = DidEstablishConnection(); |
| 788 } else { | 788 } else { |
| 789 next_state_ = STATE_CLOSE; | 789 next_state_ = STATE_CLOSE; |
| 790 } | 790 } |
| 791 return result; | 791 return result; |
| 792 } | 792 } |
| 793 | 793 |
| 794 int SocketStream::DoSSLConnect() { | 794 int SocketStream::DoSSLConnect() { |
| 795 DCHECK(factory_); | 795 DCHECK(factory_); |
| 796 // TODO(agl): look into plumbing SSLHostInfo here. |
| 796 socket_.reset(factory_->CreateSSLClientSocket( | 797 socket_.reset(factory_->CreateSSLClientSocket( |
| 797 socket_.release(), url_.HostNoBrackets(), ssl_config_)); | 798 socket_.release(), url_.HostNoBrackets(), ssl_config_, |
| 799 NULL /* ssl_host_info */)); |
| 798 next_state_ = STATE_SSL_CONNECT_COMPLETE; | 800 next_state_ = STATE_SSL_CONNECT_COMPLETE; |
| 799 metrics_->OnSSLConnection(); | 801 metrics_->OnSSLConnection(); |
| 800 return socket_->Connect(&io_callback_); | 802 return socket_->Connect(&io_callback_); |
| 801 } | 803 } |
| 802 | 804 |
| 803 int SocketStream::DoSSLConnectComplete(int result) { | 805 int SocketStream::DoSSLConnectComplete(int result) { |
| 804 if (IsCertificateError(result)) { | 806 if (IsCertificateError(result)) { |
| 805 if (socket_->IsConnectedAndIdle()) { | 807 if (socket_->IsConnectedAndIdle()) { |
| 806 result = HandleCertificateError(result); | 808 result = HandleCertificateError(result); |
| 807 } else { | 809 } else { |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 | 1019 |
| 1018 SSLConfigService* SocketStream::ssl_config_service() const { | 1020 SSLConfigService* SocketStream::ssl_config_service() const { |
| 1019 return context_->ssl_config_service(); | 1021 return context_->ssl_config_service(); |
| 1020 } | 1022 } |
| 1021 | 1023 |
| 1022 ProxyService* SocketStream::proxy_service() const { | 1024 ProxyService* SocketStream::proxy_service() const { |
| 1023 return context_->proxy_service(); | 1025 return context_->proxy_service(); |
| 1024 } | 1026 } |
| 1025 | 1027 |
| 1026 } // namespace net | 1028 } // namespace net |
| OLD | NEW |