diff options
author | rdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-12 16:25:31 +0000 |
---|---|---|
committer | rdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-12 16:25:31 +0000 |
commit | 314a69b0434608976f13c936b7dc630b5467413c (patch) | |
tree | d4e36bd6e1a4992a328c79c552f624fedafaded5 /net/socket/tcp_client_socket_libevent.h | |
parent | 761eeca283a00ac9a45c67a5efec1ec0bbf2ef13 (diff) | |
download | chromium_src-314a69b0434608976f13c936b7dc630b5467413c.zip chromium_src-314a69b0434608976f13c936b7dc630b5467413c.tar.gz chromium_src-314a69b0434608976f13c936b7dc630b5467413c.tar.bz2 |
Initial attempt at fast open UMA.
BUG=175623
R=rch@chromium.org
R=ycheng@google.com
Review URL: https://chromiumcodereview.appspot.com/13730013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193949 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/tcp_client_socket_libevent.h')
-rw-r--r-- | net/socket/tcp_client_socket_libevent.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/net/socket/tcp_client_socket_libevent.h b/net/socket/tcp_client_socket_libevent.h index 2ac1d6d..2533300 100644 --- a/net/socket/tcp_client_socket_libevent.h +++ b/net/socket/tcp_client_socket_libevent.h @@ -80,6 +80,55 @@ class NET_EXPORT_PRIVATE TCPClientSocketLibevent : public StreamSocket, CONNECT_STATE_NONE, }; + // States that a fast open socket attempt can result in. + enum FastOpenStatus { + FAST_OPEN_STATUS_UNKNOWN, + + // The initial fast open connect attempted returned synchronously, + // indicating that we had and sent a cookie along with the initial data. + FAST_OPEN_FAST_CONNECT_RETURN, + + // The initial fast open connect attempted returned asynchronously, + // indicating that we did not have a cookie for the server. + FAST_OPEN_SLOW_CONNECT_RETURN, + + // Some other error occurred on connection, so we couldn't tell if + // fast open would have worked. + FAST_OPEN_ERROR, + + // An attempt to do a fast open succeeded immediately + // (FAST_OPEN_FAST_CONNECT_RETURN) and we later confirmed that the server + // had acked the data we sent. + FAST_OPEN_SYN_DATA_ACK, + + // An attempt to do a fast open succeeded immediately + // (FAST_OPEN_FAST_CONNECT_RETURN) and we later confirmed that the server + // had nacked the data we sent. + FAST_OPEN_SYN_DATA_NACK, + + // An attempt to do a fast open succeeded immediately + // (FAST_OPEN_FAST_CONNECT_RETURN) and our probe to determine if the + // socket was using fast open failed. + FAST_OPEN_SYN_DATA_FAILED, + + // An attempt to do a fast open failed (FAST_OPEN_SLOW_CONNECT_RETURN) + // and we later confirmed that the server had acked initial data. This + // should never happen (we didn't send data, so it shouldn't have + // been acked). + FAST_OPEN_NO_SYN_DATA_ACK, + + // An attempt to do a fast open failed (FAST_OPEN_SLOW_CONNECT_RETURN) + // and we later discovered that the server had nacked initial data. This + // is the expected case results for FAST_OPEN_SLOW_CONNECT_RETURN. + FAST_OPEN_NO_SYN_DATA_NACK, + + // An attempt to do a fast open failed (FAST_OPEN_SLOW_CONNECT_RETURN) + // and our later probe for ack/nack state failed. + FAST_OPEN_NO_SYN_DATA_FAILED, + + FAST_OPEN_MAX_VALUE + }; + class ReadWatcher : public MessageLoopForIO::Watcher { public: explicit ReadWatcher(TCPClientSocketLibevent* socket) : socket_(socket) {} @@ -194,6 +243,8 @@ class NET_EXPORT_PRIVATE TCPClientSocketLibevent : public StreamSocket, // True when TCP FastOpen is in use and we have done the connect. bool tcp_fastopen_connected_; + enum FastOpenStatus fast_open_status_; + DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); }; |