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

Unified Diff: net/socket/client_socket_pool_manager.cc

Issue 451383002: Plumbing for TCP FastOpen for SSL sockets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased to master. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: net/socket/client_socket_pool_manager.cc
diff --git a/net/socket/client_socket_pool_manager.cc b/net/socket/client_socket_pool_manager.cc
index a7bf1fe5b753bc7796b1019c7260649f06a6bc06..964c01a610513498915085a1f78495deefe6be9d 100644
--- a/net/socket/client_socket_pool_manager.cc
+++ b/net/socket/client_socket_pool_manager.cc
@@ -84,7 +84,6 @@ int InitSocketPoolHelper(const GURL& request_url,
HttpNetworkSession::SocketPoolType socket_pool_type,
const OnHostResolutionCallback& resolution_callback,
const CompletionCallback& callback) {
- scoped_refptr<TransportSocketParams> tcp_params;
scoped_refptr<HttpProxySocketParams> http_proxy_params;
scoped_refptr<SOCKSSocketParams> socks_params;
scoped_ptr<HostPortPair> proxy_host_port;
@@ -155,19 +154,15 @@ int InitSocketPoolHelper(const GURL& request_url,
}
bool ignore_limits = (request_load_flags & LOAD_IGNORE_LIMITS) != 0;
- if (proxy_info.is_direct()) {
- tcp_params = new TransportSocketParams(origin_host_port,
- disable_resolver_cache,
- ignore_limits,
- resolution_callback);
- } else {
+ if (!proxy_info.is_direct()) {
ProxyServer proxy_server = proxy_info.proxy_server();
proxy_host_port.reset(new HostPortPair(proxy_server.host_port_pair()));
scoped_refptr<TransportSocketParams> proxy_tcp_params(
new TransportSocketParams(*proxy_host_port,
disable_resolver_cache,
ignore_limits,
- resolution_callback));
+ resolution_callback,
+ AUTO_CONNECT_USE_DEFAULT));
if (proxy_info.is_http() || proxy_info.is_https()) {
std::string user_agent;
@@ -175,17 +170,25 @@ int InitSocketPoolHelper(const GURL& request_url,
&user_agent);
scoped_refptr<SSLSocketParams> ssl_params;
if (proxy_info.is_https()) {
- // Set ssl_params, and unset proxy_tcp_params
- ssl_params = new SSLSocketParams(proxy_tcp_params,
- NULL,
- NULL,
- *proxy_host_port.get(),
- ssl_config_for_proxy,
- PRIVACY_MODE_DISABLED,
- load_flags,
- force_spdy_over_ssl,
- want_spdy_over_npn);
- proxy_tcp_params = NULL;
+ // TODO (jri): Enable a finch trial to use AUTO_CONNECT_ENABLED
+ // for SSL sockets.
+ proxy_tcp_params =
+ new TransportSocketParams(*proxy_host_port,
+ disable_resolver_cache,
+ ignore_limits,
+ resolution_callback,
+ AUTO_CONNECT_USE_DEFAULT);
+ // Set ssl_params, and unset proxy_tcp_params
+ ssl_params = new SSLSocketParams(proxy_tcp_params,
mmenke 2014/09/05 19:36:41 -2 indent
Jana 2014/09/05 20:38:56 Done.
+ NULL,
+ NULL,
+ *proxy_host_port.get(),
+ ssl_config_for_proxy,
+ PRIVACY_MODE_DISABLED,
+ load_flags,
+ force_spdy_over_ssl,
+ want_spdy_over_npn);
+ proxy_tcp_params = NULL;
mmenke 2014/09/05 19:36:41 -2 indent
Jana 2014/09/05 20:38:56 Done.
}
http_proxy_params =
@@ -220,8 +223,19 @@ int InitSocketPoolHelper(const GURL& request_url,
// Deal with SSL - which layers on top of any given proxy.
if (using_ssl) {
+ scoped_refptr<TransportSocketParams> ssl_tcp_params;
+ if (proxy_info.is_direct()) {
+ // Setup TCP params if non-proxied SSL connection.
+ // TODO (jri): Enable a finch trial to use AUTO_CONNECT_ENABLED
+ // for SSL sockets.
mmenke 2014/09/05 19:36:41 Make sure to update your CL description to reflect
Jana 2014/09/05 20:38:56 Done.
+ ssl_tcp_params = new TransportSocketParams(origin_host_port,
+ disable_resolver_cache,
+ ignore_limits,
+ resolution_callback,
+ AUTO_CONNECT_USE_DEFAULT);
+ }
scoped_refptr<SSLSocketParams> ssl_params =
- new SSLSocketParams(tcp_params,
+ new SSLSocketParams(ssl_tcp_params,
socks_params,
http_proxy_params,
origin_host_port,
@@ -280,7 +294,12 @@ int InitSocketPoolHelper(const GURL& request_url,
}
DCHECK(proxy_info.is_direct());
-
+ scoped_refptr<TransportSocketParams> tcp_params =
+ new TransportSocketParams(origin_host_port,
mmenke 2014/09/05 19:36:41 +2 indent.
Jana 2014/09/05 20:38:56 Done.
+ disable_resolver_cache,
+ ignore_limits,
+ resolution_callback,
+ AUTO_CONNECT_USE_DEFAULT);
TransportClientSocketPool* pool =
session->GetTransportSocketPool(socket_pool_type);
if (num_preconnect_streams) {

Powered by Google App Engine
This is Rietveld 408576698