| OLD | NEW |
| 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 #include "net/http/http_stream_factory_impl.h" | 5 #include "net/http/http_stream_factory_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 // Even if |alternative_job| has already finished, it will not have notified | 136 // Even if |alternative_job| has already finished, it will not have notified |
| 137 // the request yet, since we defer that to the next iteration of the | 137 // the request yet, since we defer that to the next iteration of the |
| 138 // MessageLoop, so starting |job| is always safe. | 138 // MessageLoop, so starting |job| is always safe. |
| 139 job->Start(request); | 139 job->Start(request); |
| 140 return request; | 140 return request; |
| 141 } | 141 } |
| 142 | 142 |
| 143 void HttpStreamFactoryImpl::PreconnectStreams( | 143 void HttpStreamFactoryImpl::PreconnectStreams( |
| 144 int num_streams, | 144 int num_streams, |
| 145 const HttpRequestInfo& request_info, | 145 const HttpRequestInfo& request_info) { |
| 146 const SSLConfig& server_ssl_config, | 146 SSLConfig server_ssl_config; |
| 147 const SSLConfig& proxy_ssl_config) { | 147 SSLConfig proxy_ssl_config; |
| 148 session_->GetSSLConfig(request_info, &server_ssl_config, &proxy_ssl_config); |
| 149 // All preconnects should perform EV certificate verification. |
| 150 server_ssl_config.verify_ev_cert = true; |
| 151 proxy_ssl_config.verify_ev_cert = true; |
| 152 |
| 148 DCHECK(!for_websockets_); | 153 DCHECK(!for_websockets_); |
| 149 AlternativeService alternative_service = GetAlternativeServiceFor( | 154 AlternativeService alternative_service = GetAlternativeServiceFor( |
| 150 request_info, nullptr, HttpStreamRequest::HTTP_STREAM); | 155 request_info, nullptr, HttpStreamRequest::HTTP_STREAM); |
| 151 HostPortPair destination(HostPortPair::FromURL(request_info.url)); | 156 HostPortPair destination(HostPortPair::FromURL(request_info.url)); |
| 152 GURL origin_url = ApplyHostMappingRules(request_info.url, &destination); | 157 GURL origin_url = ApplyHostMappingRules(request_info.url, &destination); |
| 153 if (alternative_service.protocol != UNINITIALIZED_ALTERNATE_PROTOCOL) { | 158 if (alternative_service.protocol != UNINITIALIZED_ALTERNATE_PROTOCOL) { |
| 154 if (session_->params().quic_disable_preconnect_if_0rtt && | 159 if (session_->params().quic_disable_preconnect_if_0rtt && |
| 155 alternative_service.protocol == QUIC && | 160 alternative_service.protocol == QUIC && |
| 156 session_->quic_stream_factory()->ZeroRTTEnabledFor(QuicServerId( | 161 session_->quic_stream_factory()->ZeroRTTEnabledFor(QuicServerId( |
| 157 alternative_service.host_port_pair(), request_info.privacy_mode))) { | 162 alternative_service.host_port_pair(), request_info.privacy_mode))) { |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 return true; | 368 return true; |
| 364 | 369 |
| 365 if (session_->params().transport_security_state->IsGooglePinnedHost(host)) | 370 if (session_->params().transport_security_state->IsGooglePinnedHost(host)) |
| 366 return true; | 371 return true; |
| 367 | 372 |
| 368 return ContainsKey(session_->params().quic_host_whitelist, | 373 return ContainsKey(session_->params().quic_host_whitelist, |
| 369 base::ToLowerASCII(host)); | 374 base::ToLowerASCII(host)); |
| 370 } | 375 } |
| 371 | 376 |
| 372 } // namespace net | 377 } // namespace net |
| OLD | NEW |