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

Unified Diff: net/socket/tcp_socket_libevent.h

Issue 451383002: Plumbing for TCP FastOpen for SSL sockets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved TFO enabling to client_socket_pool_manager and cleaned up tcp_socket.cc (added tcp_socket.cc … 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/tcp_socket_libevent.h
diff --git a/net/socket/tcp_socket_libevent.h b/net/socket/tcp_socket_libevent.h
index 0335c9ea2dea0587ad6ff29421f3a2b3176363dd..c073ec533145656ef82cff6b44d39ed1ba7e1699 100644
--- a/net/socket/tcp_socket_libevent.h
+++ b/net/socket/tcp_socket_libevent.h
@@ -21,6 +21,11 @@ class IOBuffer;
class IPEndPoint;
class SocketLibevent;
+// Checks if TCP FastOpen is supported by the kernel. Also enables TFO for all
+// connections if indicated by user.
+// Not thread safe. Must be called during initialization/startup only.
+NET_EXPORT void CheckSupportAndMaybeEnableTCPFastOpen(bool user_enabled);
+
class NET_EXPORT TCPSocketLibevent {
public:
TCPSocketLibevent(NetLog* net_log, const NetLog::Source& source);
@@ -65,7 +70,10 @@ class NET_EXPORT TCPSocketLibevent {
void Close();
+ // Setter/Getter methods for TCP FastOpen socket option.
bool UsingTCPFastOpen() const;
+ void EnableTCPFastOpen();
+
bool IsValid() const;
// Marks the start/end of a series of connect attempts for logging purpose.
@@ -168,12 +176,11 @@ class NET_EXPORT TCPSocketLibevent {
scoped_ptr<SocketLibevent> accept_socket_;
// Enables experimental TCP FastOpen option.
- const bool use_tcp_fastopen_;
+ bool use_tcp_fastopen_;
// True when TCP FastOpen is in use and we have done the connect.
bool tcp_fastopen_connected_;
-
- FastOpenStatus fast_open_status_;
+FastOpenStatus fast_open_status_;
bool logging_multiple_connect_attempts_;

Powered by Google App Engine
This is Rietveld 408576698