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

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: Added constructor param in TransportSocketParams to enable TFO (and some cleanup) Created 6 years, 4 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..68b485e2dad15b815355de10de1a5264d2230502 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,12 +154,7 @@ 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(
@@ -175,17 +169,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;
+ // Enable TCP FastOpen for SSL sockets.
+ // TODO (jri): Finch trial this.
+ proxy_tcp_params =
+ new TransportSocketParams(*proxy_host_port,
+ disable_resolver_cache,
+ ignore_limits,
+ resolution_callback,
+ /*use_tcp_fast_open_if_supported=*/true);
+ // 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;
}
http_proxy_params =
@@ -220,8 +222,16 @@ int InitSocketPoolHelper(const GURL& request_url,
// Deal with SSL - which layers on top of any given proxy.
if (using_ssl) {
+ // Enable TCP FastOpen for SSL socket.
+ // TODO (jri): Finch trial this.
+ scoped_refptr<TransportSocketParams> ssl_tcp_params =
+ new TransportSocketParams(origin_host_port,
+ disable_resolver_cache,
+ ignore_limits,
+ resolution_callback,
+ /*use_tcp_fast_open_if_supported=*/true);
scoped_refptr<SSLSocketParams> ssl_params =
- new SSLSocketParams(tcp_params,
+ new SSLSocketParams(ssl_tcp_params,
socks_params,
http_proxy_params,
origin_host_port,
@@ -280,7 +290,11 @@ int InitSocketPoolHelper(const GURL& request_url,
}
DCHECK(proxy_info.is_direct());
-
+ scoped_refptr<TransportSocketParams> tcp_params =
+ new TransportSocketParams(origin_host_port,
+ disable_resolver_cache,
+ ignore_limits,
+ resolution_callback);
TransportClientSocketPool* pool =
session->GetTransportSocketPool(socket_pool_type);
if (num_preconnect_streams) {
« no previous file with comments | « net/net.gypi ('k') | net/socket/stream_socket.h » ('j') | net/socket/tcp_socket_libevent.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698