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

Unified Diff: net/socket/transport_client_socket_pool.h

Issue 451383002: Plumbing for TCP FastOpen for SSL sockets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing linker error for Windows. 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
« no previous file with comments | « net/socket/tcp_socket_win.cc ('k') | net/socket/transport_client_socket_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..fce543263005160948ded6fa1a001b847e8c6602 100644
--- a/net/socket/transport_client_socket_pool.h
+++ b/net/socket/transport_client_socket_pool.h
@@ -29,14 +29,30 @@ OnHostResolutionCallback;
class NET_EXPORT_PRIVATE TransportSocketParams
: public base::RefCounted<TransportSocketParams> {
public:
+ // CombineConnectAndWrite currently translates to using TCP FastOpen.
+ // TCP FastOpen should not be used if the first write to the socket may
+ // be non-idempotent, as the underlying socket could retransmit the data
+ // on failure of the first transmission.
+ // NOTE: Currently, COMBINE_CONNECT_AND_WRITE_DESIRED is used if the data in
+ // the write is known to be idempotent, and COMBINE_CONNECT_AND_WRITE_DEFAULT
+ // is used as a default for other cases (including non-idempotent writes).
+ enum CombineConnectAndWritePolicy {
+ COMBINE_CONNECT_AND_WRITE_DEFAULT, // Default policy, implemented in
+ // TransportSocketParams constructor.
+ COMBINE_CONNECT_AND_WRITE_DESIRED, // Combine if supported by socket.
+ COMBINE_CONNECT_AND_WRITE_PROHIBITED // Do not combine.
+ };
+
// |host_resolution_callback| will be invoked after the the hostname is
// resolved. If |host_resolution_callback| does not return OK, then the
- // connection will be aborted with that value.
+ // connection will be aborted with that value. |combine_connect_and_write|
+ // defines the policy for use of TCP FastOpen on this socket.
TransportSocketParams(
const HostPortPair& host_port_pair,
bool disable_resolver_cache,
bool ignore_limits,
- const OnHostResolutionCallback& host_resolution_callback);
+ const OnHostResolutionCallback& host_resolution_callback,
+ CombineConnectAndWritePolicy combine_connect_and_write);
const HostResolver::RequestInfo& destination() const { return destination_; }
bool ignore_limits() const { return ignore_limits_; }
@@ -44,6 +60,10 @@ class NET_EXPORT_PRIVATE TransportSocketParams
return host_resolution_callback_;
}
+ CombineConnectAndWritePolicy combine_connect_and_write() const {
+ return combine_connect_and_write_;
+ }
+
private:
friend class base::RefCounted<TransportSocketParams>;
~TransportSocketParams();
@@ -51,6 +71,7 @@ class NET_EXPORT_PRIVATE TransportSocketParams
HostResolver::RequestInfo destination_;
bool ignore_limits_;
const OnHostResolutionCallback host_resolution_callback_;
+ CombineConnectAndWritePolicy combine_connect_and_write_;
DISALLOW_COPY_AND_ASSIGN(TransportSocketParams);
};
@@ -90,6 +111,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);
« no previous file with comments | « net/socket/tcp_socket_win.cc ('k') | net/socket/transport_client_socket_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698