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 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 bool direct = true; | 1090 bool direct = true; |
1091 const ProxyServer& proxy_server = proxy_info_.proxy_server(); | 1091 const ProxyServer& proxy_server = proxy_info_.proxy_server(); |
1092 PrivacyMode privacy_mode = request_info_.privacy_mode; | 1092 PrivacyMode privacy_mode = request_info_.privacy_mode; |
1093 SpdySessionKey spdy_session_key(origin_, proxy_server, privacy_mode); | 1093 SpdySessionKey spdy_session_key(origin_, proxy_server, privacy_mode); |
1094 if (IsHttpsProxyAndHttpUrl()) { | 1094 if (IsHttpsProxyAndHttpUrl()) { |
1095 // If we don't have a direct SPDY session, and we're using an HTTPS | 1095 // If we don't have a direct SPDY session, and we're using an HTTPS |
1096 // proxy, then we might have a SPDY session to the proxy. | 1096 // proxy, then we might have a SPDY session to the proxy. |
1097 // We never use privacy mode for connection to proxy server. | 1097 // We never use privacy mode for connection to proxy server. |
1098 spdy_session_key = SpdySessionKey(proxy_server.host_port_pair(), | 1098 spdy_session_key = SpdySessionKey(proxy_server.host_port_pair(), |
1099 ProxyServer::Direct(), | 1099 ProxyServer::Direct(), |
1100 kPrivacyModeDisabled); | 1100 PRIVACY_MODE_DISABLED); |
1101 direct = false; | 1101 direct = false; |
1102 } | 1102 } |
1103 | 1103 |
1104 base::WeakPtr<SpdySession> spdy_session; | 1104 base::WeakPtr<SpdySession> spdy_session; |
1105 if (existing_spdy_session_.get()) { | 1105 if (existing_spdy_session_.get()) { |
1106 // We picked up an existing session, so we don't need our socket. | 1106 // We picked up an existing session, so we don't need our socket. |
1107 if (connection_->socket()) | 1107 if (connection_->socket()) |
1108 connection_->socket()->Disconnect(); | 1108 connection_->socket()->Disconnect(); |
1109 connection_->Reset(); | 1109 connection_->Reset(); |
1110 std::swap(spdy_session, existing_spdy_session_); | 1110 std::swap(spdy_session, existing_spdy_session_); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1276 host.compare(host.size() - 10, 10, "google.com") == 0 && | 1276 host.compare(host.size() - 10, 10, "google.com") == 0 && |
1277 (host.size() == 10 || host[host.size()-11] == '.')) { | 1277 (host.size() == 10 || host[host.size()-11] == '.')) { |
1278 UMA_HISTOGRAM_ENUMERATION("Net.GoogleConnectionUsedSSLVersionFallback", | 1278 UMA_HISTOGRAM_ENUMERATION("Net.GoogleConnectionUsedSSLVersionFallback", |
1279 fallback, FALLBACK_MAX); | 1279 fallback, FALLBACK_MAX); |
1280 } | 1280 } |
1281 | 1281 |
1282 if (request_info_.load_flags & LOAD_VERIFY_EV_CERT) | 1282 if (request_info_.load_flags & LOAD_VERIFY_EV_CERT) |
1283 ssl_config->verify_ev_cert = true; | 1283 ssl_config->verify_ev_cert = true; |
1284 | 1284 |
1285 // Disable Channel ID if privacy mode is enabled. | 1285 // Disable Channel ID if privacy mode is enabled. |
1286 if (request_info_.privacy_mode == kPrivacyModeEnabled) | 1286 if (request_info_.privacy_mode == PRIVACY_MODE_ENABLED) |
1287 ssl_config->channel_id_enabled = false; | 1287 ssl_config->channel_id_enabled = false; |
1288 } | 1288 } |
1289 | 1289 |
1290 | 1290 |
1291 int HttpStreamFactoryImpl::Job::ReconsiderProxyAfterError(int error) { | 1291 int HttpStreamFactoryImpl::Job::ReconsiderProxyAfterError(int error) { |
1292 DCHECK(!pac_request_); | 1292 DCHECK(!pac_request_); |
1293 | 1293 |
1294 // A failure to resolve the hostname or any error related to establishing a | 1294 // A failure to resolve the hostname or any error related to establishing a |
1295 // TCP connection could be grounds for trying a new proxy configuration. | 1295 // TCP connection could be grounds for trying a new proxy configuration. |
1296 // | 1296 // |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1470 (net::LOAD_MAIN_FRAME | net::LOAD_SUB_FRAME | net::LOAD_PREFETCH | | 1470 (net::LOAD_MAIN_FRAME | net::LOAD_SUB_FRAME | net::LOAD_PREFETCH | |
1471 net::LOAD_IS_DOWNLOAD)) { | 1471 net::LOAD_IS_DOWNLOAD)) { |
1472 // Avoid pipelining resources that may be streamed for a long time. | 1472 // Avoid pipelining resources that may be streamed for a long time. |
1473 return false; | 1473 return false; |
1474 } | 1474 } |
1475 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining( | 1475 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining( |
1476 *http_pipelining_key_.get()); | 1476 *http_pipelining_key_.get()); |
1477 } | 1477 } |
1478 | 1478 |
1479 } // namespace net | 1479 } // namespace net |
OLD | NEW |