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

Side by Side Diff: net/http/http_stream_factory_impl_job.cc

Issue 1860343002: SHP 1: Change SupportsSpdy dict to use SchemeHostPort as the key. No change to Pref data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use proxy server scheme, remove hardcode Created 4 years, 8 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
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 #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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 stream_type_ = request_->stream_type(); 250 stream_type_ = request_->stream_type();
251 StartInternal(); 251 StartInternal();
252 } 252 }
253 253
254 int HttpStreamFactoryImpl::Job::Preconnect(int num_streams) { 254 int HttpStreamFactoryImpl::Job::Preconnect(int num_streams) {
255 DCHECK_GT(num_streams, 0); 255 DCHECK_GT(num_streams, 0);
256 base::WeakPtr<HttpServerProperties> http_server_properties = 256 base::WeakPtr<HttpServerProperties> http_server_properties =
257 session_->http_server_properties(); 257 session_->http_server_properties();
258 if (http_server_properties && 258 if (http_server_properties &&
259 http_server_properties->SupportsRequestPriority( 259 http_server_properties->SupportsRequestPriority(
260 HostPortPair::FromURL(request_info_.url))) { 260 url::SchemeHostPort(request_info_.url))) {
261 num_streams_ = 1; 261 num_streams_ = 1;
262 } else { 262 } else {
263 num_streams_ = num_streams; 263 num_streams_ = num_streams;
264 } 264 }
265 return StartInternal(); 265 return StartInternal();
266 } 266 }
267 267
268 int HttpStreamFactoryImpl::Job::RestartTunnelWithProxyAuth( 268 int HttpStreamFactoryImpl::Job::RestartTunnelWithProxyAuth(
269 const AuthCredentials& credentials) { 269 const AuthCredentials& credentials) {
270 DCHECK(establishing_tunnel_); 270 DCHECK(establishing_tunnel_);
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1417 if (spdy_session->GetProtocolVersion() >= HTTP2 && 1417 if (spdy_session->GetProtocolVersion() >= HTTP2 &&
1418 spdy_session->GetSSLInfo(&ssl_info, &was_npn_negotiated, 1418 spdy_session->GetSSLInfo(&ssl_info, &was_npn_negotiated,
1419 &protocol_negotiated)) { 1419 &protocol_negotiated)) {
1420 UMA_HISTOGRAM_SPARSE_SLOWLY( 1420 UMA_HISTOGRAM_SPARSE_SLOWLY(
1421 "Net.Http2SSLCipherSuite", 1421 "Net.Http2SSLCipherSuite",
1422 SSLConnectionStatusToCipherSuite(ssl_info.connection_status)); 1422 SSLConnectionStatusToCipherSuite(ssl_info.connection_status));
1423 } 1423 }
1424 1424
1425 new_spdy_session_ = spdy_session; 1425 new_spdy_session_ = spdy_session;
1426 spdy_session_direct_ = direct; 1426 spdy_session_direct_ = direct;
1427 const HostPortPair& host_port_pair = spdy_session_key.host_port_pair(); 1427 const HostPortPair host_port_pair = spdy_session_key.host_port_pair();
1428 bool is_https = spdy_session_key.proxy_server().is_https();
Ryan Hamilton 2016/04/07 18:27:40 This doesn't seem right since you're checking the
Zhongyi Shi 2016/04/07 21:19:34 Sorry for miss that. Using SSL info on the session
1429 url::SchemeHostPort scheme_host_port(is_https ? "https" : "http",
1430 host_port_pair.host(),
1431 host_port_pair.port());
1432
1428 base::WeakPtr<HttpServerProperties> http_server_properties = 1433 base::WeakPtr<HttpServerProperties> http_server_properties =
1429 session_->http_server_properties(); 1434 session_->http_server_properties();
1430 if (http_server_properties) 1435 if (http_server_properties)
1431 http_server_properties->SetSupportsSpdy(host_port_pair, true); 1436 http_server_properties->SetSupportsSpdy(scheme_host_port, true);
1432 1437
1433 // Create a SpdyHttpStream or a BidirectionalStreamImpl attached to the 1438 // Create a SpdyHttpStream or a BidirectionalStreamImpl attached to the
1434 // session; OnNewSpdySessionReadyCallback is not called until an event loop 1439 // session; OnNewSpdySessionReadyCallback is not called until an event loop
1435 // iteration later, so if the SpdySession is closed between then, allow 1440 // iteration later, so if the SpdySession is closed between then, allow
1436 // reuse state from the underlying socket, sampled by SpdyHttpStream, 1441 // reuse state from the underlying socket, sampled by SpdyHttpStream,
1437 // bubble up to the request. 1442 // bubble up to the request.
1438 return SetSpdyHttpStreamOrBidirectionalStreamImpl(new_spdy_session_, 1443 return SetSpdyHttpStreamOrBidirectionalStreamImpl(new_spdy_session_,
1439 spdy_session_direct_); 1444 spdy_session_direct_);
1440 } 1445 }
1441 1446
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
1800 if (connection_->socket()) { 1805 if (connection_->socket()) {
1801 ConnectionAttempts socket_attempts; 1806 ConnectionAttempts socket_attempts;
1802 connection_->socket()->GetConnectionAttempts(&socket_attempts); 1807 connection_->socket()->GetConnectionAttempts(&socket_attempts);
1803 request_->AddConnectionAttempts(socket_attempts); 1808 request_->AddConnectionAttempts(socket_attempts);
1804 } else { 1809 } else {
1805 request_->AddConnectionAttempts(connection_->connection_attempts()); 1810 request_->AddConnectionAttempts(connection_->connection_attempts());
1806 } 1811 }
1807 } 1812 }
1808 1813
1809 } // namespace net 1814 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698