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

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

Issue 10581020: Prevent requests for http://host:port/ from being sent over an existing spdy session to https://hos… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix willchan's comments Created 8 years, 6 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 | Annotate | Revision Log
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 HostPortProxyPair spdy_session_key; 673 HostPortProxyPair spdy_session_key;
674 if (IsHttpsProxyAndHttpUrl()) { 674 if (IsHttpsProxyAndHttpUrl()) {
675 spdy_session_key = 675 spdy_session_key =
676 HostPortProxyPair(proxy_info_.proxy_server().host_port_pair(), 676 HostPortProxyPair(proxy_info_.proxy_server().host_port_pair(),
677 ProxyServer::Direct()); 677 ProxyServer::Direct());
678 } else { 678 } else {
679 spdy_session_key = HostPortProxyPair(origin_, proxy_info_.proxy_server()); 679 spdy_session_key = HostPortProxyPair(origin_, proxy_info_.proxy_server());
680 } 680 }
681 scoped_refptr<SpdySession> spdy_session = 681 scoped_refptr<SpdySession> spdy_session =
682 session_->spdy_session_pool()->GetIfExists(spdy_session_key, net_log_); 682 session_->spdy_session_pool()->GetIfExists(spdy_session_key, net_log_);
683 if (spdy_session) { 683 if (spdy_session && (request_info_.url.SchemeIs("https") ||
willchan no longer on Chromium 2012/06/29 17:19:45 Please add comments explaining what this condition
Ryan Hamilton 2012/06/29 17:37:34 Done.
684 proxy_info_.proxy_server().is_https() ||
685 force_spdy_always_)) {
684 // If we're preconnecting, but we already have a SpdySession, we don't 686 // If we're preconnecting, but we already have a SpdySession, we don't
685 // actually need to preconnect any sockets, so we're done. 687 // actually need to preconnect any sockets, so we're done.
686 if (IsPreconnecting()) 688 if (IsPreconnecting())
687 return OK; 689 return OK;
688 using_spdy_ = true; 690 using_spdy_ = true;
689 next_state_ = STATE_CREATE_STREAM; 691 next_state_ = STATE_CREATE_STREAM;
690 existing_spdy_session_ = spdy_session; 692 existing_spdy_session_ = spdy_session;
691 return OK; 693 return OK;
692 } else if (request_ && (using_ssl_ || ShouldForceSpdyWithoutSSL())) { 694 } else if (request_ && (using_ssl_ || ShouldForceSpdyWithoutSSL())) {
693 // Update the spdy session key for the request that launched this job. 695 // Update the spdy session key for the request that launched this job.
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 (net::LOAD_MAIN_FRAME | net::LOAD_SUB_FRAME | net::LOAD_PREFETCH | 1275 (net::LOAD_MAIN_FRAME | net::LOAD_SUB_FRAME | net::LOAD_PREFETCH |
1274 net::LOAD_IS_DOWNLOAD)) { 1276 net::LOAD_IS_DOWNLOAD)) {
1275 // Avoid pipelining resources that may be streamed for a long time. 1277 // Avoid pipelining resources that may be streamed for a long time.
1276 return false; 1278 return false;
1277 } 1279 }
1278 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining( 1280 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining(
1279 *http_pipelining_key_.get()); 1281 *http_pipelining_key_.get());
1280 } 1282 }
1281 1283
1282 } // namespace net 1284 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698