| 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 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 } | 249 } |
| 250 | 250 |
| 251 void HttpStreamFactoryImpl::Job::Start( | 251 void HttpStreamFactoryImpl::Job::Start( |
| 252 HttpStreamRequest::StreamType stream_type) { | 252 HttpStreamRequest::StreamType stream_type) { |
| 253 stream_type_ = stream_type; | 253 stream_type_ = stream_type; |
| 254 StartInternal(); | 254 StartInternal(); |
| 255 } | 255 } |
| 256 | 256 |
| 257 int HttpStreamFactoryImpl::Job::Preconnect(int num_streams) { | 257 int HttpStreamFactoryImpl::Job::Preconnect(int num_streams) { |
| 258 DCHECK_GT(num_streams, 0); | 258 DCHECK_GT(num_streams, 0); |
| 259 base::WeakPtr<HttpServerProperties> http_server_properties = | 259 HttpServerProperties* http_server_properties = |
| 260 session_->http_server_properties(); | 260 session_->http_server_properties(); |
| 261 if (http_server_properties && | 261 if (http_server_properties && |
| 262 http_server_properties->SupportsRequestPriority( | 262 http_server_properties->SupportsRequestPriority( |
| 263 url::SchemeHostPort(request_info_.url))) { | 263 url::SchemeHostPort(request_info_.url))) { |
| 264 num_streams_ = 1; | 264 num_streams_ = 1; |
| 265 } else { | 265 } else { |
| 266 num_streams_ = num_streams; | 266 num_streams_ = num_streams; |
| 267 } | 267 } |
| 268 return StartInternal(); | 268 return StartInternal(); |
| 269 } | 269 } |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 if (waiting_job_) { | 1009 if (waiting_job_) { |
| 1010 waiting_job_->Resume(this, base::TimeDelta()); | 1010 waiting_job_->Resume(this, base::TimeDelta()); |
| 1011 waiting_job_ = NULL; | 1011 waiting_job_ = NULL; |
| 1012 } | 1012 } |
| 1013 | 1013 |
| 1014 if (proxy_info_.is_http() || proxy_info_.is_https()) | 1014 if (proxy_info_.is_http() || proxy_info_.is_https()) |
| 1015 establishing_tunnel_ = using_ssl_; | 1015 establishing_tunnel_ = using_ssl_; |
| 1016 | 1016 |
| 1017 const bool expect_spdy = IsSpdyAlternative(); | 1017 const bool expect_spdy = IsSpdyAlternative(); |
| 1018 | 1018 |
| 1019 base::WeakPtr<HttpServerProperties> http_server_properties = | 1019 HttpServerProperties* http_server_properties = |
| 1020 session_->http_server_properties(); | 1020 session_->http_server_properties(); |
| 1021 if (http_server_properties) { | 1021 if (http_server_properties) { |
| 1022 http_server_properties->MaybeForceHTTP11(destination_, &server_ssl_config_); | 1022 http_server_properties->MaybeForceHTTP11(destination_, &server_ssl_config_); |
| 1023 if (proxy_info_.is_http() || proxy_info_.is_https()) { | 1023 if (proxy_info_.is_http() || proxy_info_.is_https()) { |
| 1024 http_server_properties->MaybeForceHTTP11( | 1024 http_server_properties->MaybeForceHTTP11( |
| 1025 proxy_info_.proxy_server().host_port_pair(), &proxy_ssl_config_); | 1025 proxy_info_.proxy_server().host_port_pair(), &proxy_ssl_config_); |
| 1026 } | 1026 } |
| 1027 } | 1027 } |
| 1028 | 1028 |
| 1029 if (job_type_ == PRECONNECT) { | 1029 if (job_type_ == PRECONNECT) { |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1360 } | 1360 } |
| 1361 | 1361 |
| 1362 new_spdy_session_ = spdy_session; | 1362 new_spdy_session_ = spdy_session; |
| 1363 spdy_session_direct_ = direct; | 1363 spdy_session_direct_ = direct; |
| 1364 const HostPortPair host_port_pair = spdy_session_key.host_port_pair(); | 1364 const HostPortPair host_port_pair = spdy_session_key.host_port_pair(); |
| 1365 bool is_https = ssl_info.is_valid(); | 1365 bool is_https = ssl_info.is_valid(); |
| 1366 url::SchemeHostPort scheme_host_port(is_https ? "https" : "http", | 1366 url::SchemeHostPort scheme_host_port(is_https ? "https" : "http", |
| 1367 host_port_pair.host(), | 1367 host_port_pair.host(), |
| 1368 host_port_pair.port()); | 1368 host_port_pair.port()); |
| 1369 | 1369 |
| 1370 base::WeakPtr<HttpServerProperties> http_server_properties = | 1370 HttpServerProperties* http_server_properties = |
| 1371 session_->http_server_properties(); | 1371 session_->http_server_properties(); |
| 1372 if (http_server_properties) | 1372 if (http_server_properties) |
| 1373 http_server_properties->SetSupportsSpdy(scheme_host_port, true); | 1373 http_server_properties->SetSupportsSpdy(scheme_host_port, true); |
| 1374 | 1374 |
| 1375 // Create a SpdyHttpStream or a BidirectionalStreamImpl attached to the | 1375 // Create a SpdyHttpStream or a BidirectionalStreamImpl attached to the |
| 1376 // session; OnNewSpdySessionReadyCallback is not called until an event loop | 1376 // session; OnNewSpdySessionReadyCallback is not called until an event loop |
| 1377 // iteration later, so if the SpdySession is closed between then, allow | 1377 // iteration later, so if the SpdySession is closed between then, allow |
| 1378 // reuse state from the underlying socket, sampled by SpdyHttpStream, | 1378 // reuse state from the underlying socket, sampled by SpdyHttpStream, |
| 1379 // bubble up to the request. | 1379 // bubble up to the request. |
| 1380 return SetSpdyHttpStreamOrBidirectionalStreamImpl(new_spdy_session_, | 1380 return SetSpdyHttpStreamOrBidirectionalStreamImpl(new_spdy_session_, |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1731 | 1731 |
| 1732 ConnectionAttempts socket_attempts = connection_->connection_attempts(); | 1732 ConnectionAttempts socket_attempts = connection_->connection_attempts(); |
| 1733 if (connection_->socket()) { | 1733 if (connection_->socket()) { |
| 1734 connection_->socket()->GetConnectionAttempts(&socket_attempts); | 1734 connection_->socket()->GetConnectionAttempts(&socket_attempts); |
| 1735 } | 1735 } |
| 1736 | 1736 |
| 1737 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); | 1737 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); |
| 1738 } | 1738 } |
| 1739 | 1739 |
| 1740 } // namespace net | 1740 } // namespace net |
| OLD | NEW |