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

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: 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 // TODO(zhongyi): remove hardcoded scheme.
1429 url::SchemeHostPort scheme_host_port("http", host_port_pair.host(),
1430 host_port_pair.port());
Ryan Hamilton 2016/04/06 19:16:08 I think we need to fix this now. What would it tak
Zhongyi Shi 2016/04/07 00:31:18 Done.
1428 base::WeakPtr<HttpServerProperties> http_server_properties = 1431 base::WeakPtr<HttpServerProperties> http_server_properties =
1429 session_->http_server_properties(); 1432 session_->http_server_properties();
1430 if (http_server_properties) 1433 if (http_server_properties)
1431 http_server_properties->SetSupportsSpdy(host_port_pair, true); 1434 http_server_properties->SetSupportsSpdy(scheme_host_port, true);
1432 1435
1433 // Create a SpdyHttpStream or a BidirectionalStreamImpl attached to the 1436 // Create a SpdyHttpStream or a BidirectionalStreamImpl attached to the
1434 // session; OnNewSpdySessionReadyCallback is not called until an event loop 1437 // session; OnNewSpdySessionReadyCallback is not called until an event loop
1435 // iteration later, so if the SpdySession is closed between then, allow 1438 // iteration later, so if the SpdySession is closed between then, allow
1436 // reuse state from the underlying socket, sampled by SpdyHttpStream, 1439 // reuse state from the underlying socket, sampled by SpdyHttpStream,
1437 // bubble up to the request. 1440 // bubble up to the request.
1438 return SetSpdyHttpStreamOrBidirectionalStreamImpl(new_spdy_session_, 1441 return SetSpdyHttpStreamOrBidirectionalStreamImpl(new_spdy_session_,
1439 spdy_session_direct_); 1442 spdy_session_direct_);
1440 } 1443 }
1441 1444
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
1800 if (connection_->socket()) { 1803 if (connection_->socket()) {
1801 ConnectionAttempts socket_attempts; 1804 ConnectionAttempts socket_attempts;
1802 connection_->socket()->GetConnectionAttempts(&socket_attempts); 1805 connection_->socket()->GetConnectionAttempts(&socket_attempts);
1803 request_->AddConnectionAttempts(socket_attempts); 1806 request_->AddConnectionAttempts(socket_attempts);
1804 } else { 1807 } else {
1805 request_->AddConnectionAttempts(connection_->connection_attempts()); 1808 request_->AddConnectionAttempts(connection_->connection_attempts());
1806 } 1809 }
1807 } 1810 }
1808 1811
1809 } // namespace net 1812 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698