| 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 } | 395 } |
| 396 | 396 |
| 397 SpdySessionKey HttpStreamFactoryImpl::Job::GetSpdySessionKey() const { | 397 SpdySessionKey HttpStreamFactoryImpl::Job::GetSpdySessionKey() const { |
| 398 // In the case that we're using an HTTPS proxy for an HTTP url, | 398 // In the case that we're using an HTTPS proxy for an HTTP url, |
| 399 // we look for a SPDY session *to* the proxy, instead of to the | 399 // we look for a SPDY session *to* the proxy, instead of to the |
| 400 // origin server. | 400 // origin server. |
| 401 if (IsHttpsProxyAndHttpUrl()) { | 401 if (IsHttpsProxyAndHttpUrl()) { |
| 402 return SpdySessionKey(proxy_info_.proxy_server().host_port_pair(), | 402 return SpdySessionKey(proxy_info_.proxy_server().host_port_pair(), |
| 403 ProxyServer::Direct(), PRIVACY_MODE_DISABLED); | 403 ProxyServer::Direct(), PRIVACY_MODE_DISABLED); |
| 404 } | 404 } |
| 405 return SpdySessionKey(destination_, proxy_info_.proxy_server(), | 405 return SpdySessionKey(HostPortPair::FromURL(origin_url_), |
| 406 request_info_.privacy_mode); | 406 proxy_info_.proxy_server(), request_info_.privacy_mode); |
| 407 } | 407 } |
| 408 | 408 |
| 409 bool HttpStreamFactoryImpl::Job::CanUseExistingSpdySession() const { | 409 bool HttpStreamFactoryImpl::Job::CanUseExistingSpdySession() const { |
| 410 // We need to make sure that if a spdy session was created for | 410 // We need to make sure that if a spdy session was created for |
| 411 // https://somehost/ that we don't use that session for http://somehost:443/. | 411 // https://somehost/ that we don't use that session for http://somehost:443/. |
| 412 // The only time we can use an existing session is if the request URL is | 412 // The only time we can use an existing session is if the request URL is |
| 413 // https (the normal case) or if we're connection to a SPDY proxy. | 413 // https (the normal case) or if we're connection to a SPDY proxy. |
| 414 // https://crbug.com/133176 | 414 // https://crbug.com/133176 |
| 415 // TODO(ricea): Add "wss" back to this list when SPDY WebSocket support is | 415 // TODO(ricea): Add "wss" back to this list when SPDY WebSocket support is |
| 416 // working. | 416 // working. |
| (...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1503 bool enable_ip_based_pooling, | 1503 bool enable_ip_based_pooling, |
| 1504 NetLog* net_log) { | 1504 NetLog* net_log) { |
| 1505 return new HttpStreamFactoryImpl::Job( | 1505 return new HttpStreamFactoryImpl::Job( |
| 1506 delegate, job_type, session, request_info, priority, proxy_info, | 1506 delegate, job_type, session, request_info, priority, proxy_info, |
| 1507 server_ssl_config, proxy_ssl_config, destination, origin_url, | 1507 server_ssl_config, proxy_ssl_config, destination, origin_url, |
| 1508 AlternativeService(), alternative_proxy_server, enable_ip_based_pooling, | 1508 AlternativeService(), alternative_proxy_server, enable_ip_based_pooling, |
| 1509 net_log); | 1509 net_log); |
| 1510 } | 1510 } |
| 1511 | 1511 |
| 1512 } // namespace net | 1512 } // namespace net |
| OLD | NEW |