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_job.h" | 5 #include "net/http/http_stream_factory_impl_job.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 session_(session), | 210 session_(session), |
211 next_state_(STATE_NONE), | 211 next_state_(STATE_NONE), |
212 pac_request_(NULL), | 212 pac_request_(NULL), |
213 destination_(destination), | 213 destination_(destination), |
214 origin_url_(origin_url), | 214 origin_url_(origin_url), |
215 alternative_service_(alternative_service), | 215 alternative_service_(alternative_service), |
216 alternative_proxy_server_(alternative_proxy_server), | 216 alternative_proxy_server_(alternative_proxy_server), |
217 enable_ip_based_pooling_(enable_ip_based_pooling), | 217 enable_ip_based_pooling_(enable_ip_based_pooling), |
218 delegate_(delegate), | 218 delegate_(delegate), |
219 job_type_(job_type), | 219 job_type_(job_type), |
220 using_ssl_(false), | 220 using_ssl_(origin_url_.SchemeIs(url::kHttpsScheme) || |
| 221 origin_url_.SchemeIs(url::kWssScheme)), |
221 using_spdy_(false), | 222 using_spdy_(false), |
222 using_quic_(false), | 223 using_quic_(false), |
223 quic_request_(session_->quic_stream_factory(), | 224 quic_request_(session_->quic_stream_factory(), |
224 session_->http_server_properties()), | 225 session_->http_server_properties()), |
225 using_existing_quic_session_(false), | 226 using_existing_quic_session_(false), |
226 establishing_tunnel_(false), | 227 establishing_tunnel_(false), |
227 was_alpn_negotiated_(false), | 228 was_alpn_negotiated_(false), |
228 negotiated_protocol_(kProtoUnknown), | 229 negotiated_protocol_(kProtoUnknown), |
229 num_streams_(0), | 230 num_streams_(0), |
230 spdy_session_direct_(false), | 231 spdy_session_direct_(false), |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 "462812 HttpStreamFactoryImpl::Job::DoInitConnection")); | 864 "462812 HttpStreamFactoryImpl::Job::DoInitConnection")); |
864 DCHECK(!connection_->is_initialized()); | 865 DCHECK(!connection_->is_initialized()); |
865 DCHECK(proxy_info_.proxy_server().is_valid()); | 866 DCHECK(proxy_info_.proxy_server().is_valid()); |
866 next_state_ = STATE_INIT_CONNECTION_COMPLETE; | 867 next_state_ = STATE_INIT_CONNECTION_COMPLETE; |
867 | 868 |
868 if (delegate_->OnInitConnection(proxy_info_)) { | 869 if (delegate_->OnInitConnection(proxy_info_)) { |
869 // Return since the connection initialization can be skipped. | 870 // Return since the connection initialization can be skipped. |
870 return OK; | 871 return OK; |
871 } | 872 } |
872 | 873 |
873 using_ssl_ = origin_url_.SchemeIs(url::kHttpsScheme) || | |
874 origin_url_.SchemeIs(url::kWssScheme); | |
875 using_spdy_ = false; | 874 using_spdy_ = false; |
876 | 875 |
877 if (ShouldForceQuic()) | 876 if (ShouldForceQuic()) |
878 using_quic_ = true; | 877 using_quic_ = true; |
879 | 878 |
880 DCHECK(!using_quic_ || session_->IsQuicEnabled()); | 879 DCHECK(!using_quic_ || session_->IsQuicEnabled()); |
881 | 880 |
882 if (proxy_info_.is_quic()) { | 881 if (proxy_info_.is_quic()) { |
883 using_quic_ = true; | 882 using_quic_ = true; |
884 DCHECK(session_->IsQuicEnabled()); | 883 DCHECK(session_->IsQuicEnabled()); |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1547 | 1546 |
1548 ConnectionAttempts socket_attempts = connection_->connection_attempts(); | 1547 ConnectionAttempts socket_attempts = connection_->connection_attempts(); |
1549 if (connection_->socket()) { | 1548 if (connection_->socket()) { |
1550 connection_->socket()->GetConnectionAttempts(&socket_attempts); | 1549 connection_->socket()->GetConnectionAttempts(&socket_attempts); |
1551 } | 1550 } |
1552 | 1551 |
1553 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); | 1552 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); |
1554 } | 1553 } |
1555 | 1554 |
1556 } // namespace net | 1555 } // namespace net |
OLD | NEW |