Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: net/socket_stream/socket_stream.cc

Issue 16501002: Give more request types a TransportSecurityState. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Enforce CalledOnValidThread in all non-static methods. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/socket_stream/socket_stream.h ('k') | net/spdy/spdy_test_util_common.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 } else { 982 } else {
983 next_state_ = STATE_CLOSE; 983 next_state_ = STATE_CLOSE;
984 } 984 }
985 return result; 985 return result;
986 } 986 }
987 987
988 int SocketStream::DoSecureProxyConnect() { 988 int SocketStream::DoSecureProxyConnect() {
989 DCHECK(factory_); 989 DCHECK(factory_);
990 SSLClientSocketContext ssl_context; 990 SSLClientSocketContext ssl_context;
991 ssl_context.cert_verifier = context_->cert_verifier(); 991 ssl_context.cert_verifier = context_->cert_verifier();
992 ssl_context.transport_security_state = context_->transport_security_state();
992 ssl_context.server_bound_cert_service = context_->server_bound_cert_service(); 993 ssl_context.server_bound_cert_service = context_->server_bound_cert_service();
993 socket_.reset(factory_->CreateSSLClientSocket( 994 socket_.reset(factory_->CreateSSLClientSocket(
994 socket_.release(), 995 socket_.release(),
995 proxy_info_.proxy_server().host_port_pair(), 996 proxy_info_.proxy_server().host_port_pair(),
996 proxy_ssl_config_, 997 proxy_ssl_config_,
997 ssl_context)); 998 ssl_context));
998 next_state_ = STATE_SECURE_PROXY_CONNECT_COMPLETE; 999 next_state_ = STATE_SECURE_PROXY_CONNECT_COMPLETE;
999 metrics_->OnCountConnectionType(SocketStreamMetrics::SECURE_PROXY_CONNECTION); 1000 metrics_->OnCountConnectionType(SocketStreamMetrics::SECURE_PROXY_CONNECTION);
1000 return socket_->Connect(io_callback_); 1001 return socket_->Connect(io_callback_);
1001 } 1002 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 } else { 1036 } else {
1036 next_state_ = STATE_CLOSE; 1037 next_state_ = STATE_CLOSE;
1037 } 1038 }
1038 return result; 1039 return result;
1039 } 1040 }
1040 1041
1041 int SocketStream::DoSSLConnect() { 1042 int SocketStream::DoSSLConnect() {
1042 DCHECK(factory_); 1043 DCHECK(factory_);
1043 SSLClientSocketContext ssl_context; 1044 SSLClientSocketContext ssl_context;
1044 ssl_context.cert_verifier = context_->cert_verifier(); 1045 ssl_context.cert_verifier = context_->cert_verifier();
1046 ssl_context.transport_security_state = context_->transport_security_state();
1045 ssl_context.server_bound_cert_service = context_->server_bound_cert_service(); 1047 ssl_context.server_bound_cert_service = context_->server_bound_cert_service();
1046 socket_.reset(factory_->CreateSSLClientSocket(socket_.release(), 1048 socket_.reset(factory_->CreateSSLClientSocket(socket_.release(),
1047 HostPortPair::FromURL(url_), 1049 HostPortPair::FromURL(url_),
1048 server_ssl_config_, 1050 server_ssl_config_,
1049 ssl_context)); 1051 ssl_context));
1050 next_state_ = STATE_SSL_CONNECT_COMPLETE; 1052 next_state_ = STATE_SSL_CONNECT_COMPLETE;
1051 metrics_->OnCountConnectionType(SocketStreamMetrics::SSL_CONNECTION); 1053 metrics_->OnCountConnectionType(SocketStreamMetrics::SSL_CONNECTION);
1052 return socket_->Connect(io_callback_); 1054 return socket_->Connect(io_callback_);
1053 } 1055 }
1054 1056
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 context_->transport_security_state()->GetDomainState(url_.host(), 1315 context_->transport_security_state()->GetDomainState(url_.host(),
1314 SSLConfigService::IsSNIAvailable(context_->ssl_config_service()), 1316 SSLConfigService::IsSNIAvailable(context_->ssl_config_service()),
1315 &domain_state) && 1317 &domain_state) &&
1316 domain_state.ShouldSSLErrorsBeFatal(); 1318 domain_state.ShouldSSLErrorsBeFatal();
1317 1319
1318 delegate_->OnSSLCertificateError(this, ssl_info, fatal); 1320 delegate_->OnSSLCertificateError(this, ssl_info, fatal);
1319 return ERR_IO_PENDING; 1321 return ERR_IO_PENDING;
1320 } 1322 }
1321 1323
1322 } // namespace net 1324 } // namespace net
OLDNEW
« no previous file with comments | « net/socket_stream/socket_stream.h ('k') | net/spdy/spdy_test_util_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698