Chromium Code Reviews| Index: net/socket/transport_client_socket_pool.h |
| diff --git a/net/socket/transport_client_socket_pool.h b/net/socket/transport_client_socket_pool.h |
| index 003008a372ddfa1a20f4b566a583ed545b3e5f5d..8722dc52e34e89ced996c4648b299b30d137791c 100644 |
| --- a/net/socket/transport_client_socket_pool.h |
| +++ b/net/socket/transport_client_socket_pool.h |
| @@ -21,6 +21,15 @@ |
| namespace net { |
| +// Auto-connect currently translates to using TCP Fast Open. |
| +// NOTE: For TCP Fast Open, enable if the write is known to be idempotent, |
| +// and if a write on the socket is guaranteed to happen before any reads. |
| +enum AutoConnectWithWritePolicy { |
| + AUTO_CONNECT_USE_DEFAULT, |
| + AUTO_CONNECT_ENABLED, |
| + AUTO_CONNECT_DISABLED |
|
mmenke
2014/09/05 19:36:42
I find these names very confusing - I have no idea
mmenke
2014/09/05 19:36:42
These should probably be a member of TransportSock
Jana
2014/09/05 20:38:57
As discussed offline, I am happy to change these i
Jana
2014/09/05 20:38:57
SG. I'll do this when we decide what they should b
|
| +}; |
| + |
| class ClientSocketFactory; |
| typedef base::Callback<int(const AddressList&, const BoundNetLog& net_log)> |
| @@ -38,12 +47,24 @@ class NET_EXPORT_PRIVATE TransportSocketParams |
| bool ignore_limits, |
| const OnHostResolutionCallback& host_resolution_callback); |
| + // Same as above with one additional boolean to enable use of TCP FastOpen. |
| + TransportSocketParams( |
| + const HostPortPair& host_port_pair, |
| + bool disable_resolver_cache, |
| + bool ignore_limits, |
| + const OnHostResolutionCallback& host_resolution_callback, |
| + AutoConnectWithWritePolicy auto_connect_with_write_if_supported); |
| + |
| const HostResolver::RequestInfo& destination() const { return destination_; } |
| bool ignore_limits() const { return ignore_limits_; } |
| const OnHostResolutionCallback& host_resolution_callback() const { |
| return host_resolution_callback_; |
| } |
| + AutoConnectWithWritePolicy auto_connect_with_write() const { |
| + return auto_connect_with_write_; |
| + } |
| + |
| private: |
| friend class base::RefCounted<TransportSocketParams>; |
| ~TransportSocketParams(); |
| @@ -51,6 +72,7 @@ class NET_EXPORT_PRIVATE TransportSocketParams |
| HostResolver::RequestInfo destination_; |
| bool ignore_limits_; |
| const OnHostResolutionCallback host_resolution_callback_; |
| + AutoConnectWithWritePolicy auto_connect_with_write_; |
| DISALLOW_COPY_AND_ASSIGN(TransportSocketParams); |
| }; |
| @@ -90,6 +112,7 @@ class NET_EXPORT_PRIVATE TransportConnectJobHelper { |
| State next_state() const { return next_state_; } |
| void set_next_state(State next_state) { next_state_ = next_state; } |
| CompletionCallback on_io_complete() const { return on_io_complete_; } |
| + const TransportSocketParams* params() { return params_.get(); } |
| int DoResolveHost(RequestPriority priority, const BoundNetLog& net_log); |
| int DoResolveHostComplete(int result, const BoundNetLog& net_log); |